diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 2 | ||||
| -rw-r--r-- | src/mailman/rest/helpers.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index ed062eed2..0b2ef0d41 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -91,6 +91,8 @@ REST server owners as `IUser`s. (Closes #135) * By POSTing to a user resource with an existing unlinked address, you can link the address to the user. Given by Abhilash Raj. + * Fix pagination values `start` and `total_size` in the REST API. Given by + Aurélien Bompard. (Closes: #154) Other ----- diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py index a78f5b379..4ea5b130c 100644 --- a/src/mailman/rest/helpers.py +++ b/src/mailman/rest/helpers.py @@ -20,6 +20,7 @@ __all__ = [ 'BadRequest', 'ChildError', + 'CollectionMixin', 'GetterSetter', 'NotFound', 'bad_request', @@ -148,10 +149,11 @@ class CollectionMixin: def _paginate(self, request, collection): """Method to paginate through collection result lists. - Use this to return only a slice of a collection, specified in the request - itself. The request should use query parameters `count` and `page` to - specify the slice they want. The slice will start at index - ``(page - 1) * count`` and end (exclusive) at ``(page * count)``. + Use this to return only a slice of a collection, specified in + the request itself. The request should use query parameters + `count` and `page` to specify the slice they want. The slice + will start at index ``(page - 1) * count`` and end (exclusive) + at ``(page * count)``. """ # Allow falcon's HTTPBadRequest exceptions to percolate up. They'll # get turned into HTTP 400 errors. |
