summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2015-11-06 14:17:40 -0600
committerBarry Warsaw2015-11-06 14:17:40 -0600
commitbd8b1d5f0e7c9d89ab7e68cd361450dd18a24ae3 (patch)
tree232f115c41e5917997319d7d4267f98e9d9e4f62 /src
parenta5b6568179b9b17b2dd14b43bcccded15bf5025d (diff)
downloadmailman-bd8b1d5f0e7c9d89ab7e68cd361450dd18a24ae3.tar.gz
mailman-bd8b1d5f0e7c9d89ab7e68cd361450dd18a24ae3.tar.zst
mailman-bd8b1d5f0e7c9d89ab7e68cd361450dd18a24ae3.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/docs/NEWS.rst2
-rw-r--r--src/mailman/rest/helpers.py10
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.