Skip to content

Commit

Permalink
bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Jan 2, 2022
1 parent 70b4671 commit 0715b36
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
22 changes: 22 additions & 0 deletions CHANGES → CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
Changes
=======

0.32.0
------
Added support for the ``Content-Range`` HTTP header in the GET endpoint of
``PiccoloCRUD``. This means the API client can fetch the number of available
rows, without doing a separate API call to the ``count`` endpoint.

```
GET /?__range_header=true
```

If the page size is 10, then the response header then looks something like:

```
Content-Range: movie 0-9/100
```

The feature was created to make Piccolo APIs work better with front ends like
`React Admin <https://marmelab.com/react-admin/>`_.

Thanks to @trondhindenes for adding this feature, and @sinisaos for help
reviewing.

0.31.0
------
Added hooks to ``PiccoloCRUD``. This allows the user to add their own logic
Expand Down
2 changes: 1 addition & 1 deletion docs/source/changes/index.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.. include:: ../../../CHANGES
.. include:: ../../../CHANGES.rst
7 changes: 4 additions & 3 deletions docs/source/crud/piccolo_crud.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ Content-Range header
In some applications it can be practical to get information about the
total number of records without invoking a separate call to
the ``count`` endpoint. Piccolo API will supply this information in the
``Content-Range`` response header if the ``__range_header`` http parameter
``Content-Range`` response header if the ``__range_header`` GET parameter
is set to ``true``.
You can use the ``__range_header_name`` http parameter to configure the

You can use the ``__range_header_name`` GET parameter to configure the
"plural name" used in the ``Content-Range`` response header.

The contents of the ``Content-Range`` header might look something like this
Expand All @@ -309,7 +310,7 @@ Example usage:

.. code-block::
GET /movie/?__page=2&page_size=10&__range_header=true
GET /movie/?__page=2&__page_size=10&__range_header=true
-------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion piccolo_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "0.31.0"
__VERSION__ = "0.32.0"

0 comments on commit 0715b36

Please sign in to comment.