summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-11-01 17:07:30 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-11-01 17:07:30 +0100
commit38d446737f45ea54136d1f03f75fbddf46c45e00 (patch)
treec4ccbe765f075313d1f7dc1ef476f4f09f172ab1 /docs/api-usage.rst
parentfba7730161c15be222a22b4618d79bb92a87ef1f (diff)
downloadgitlab-38d446737f45ea54136d1f03f75fbddf46c45e00.tar.gz
Pagination generators: expose more information
Expose the X-* pagination attributes returned by the Gitlab server when requesting lists. Closes #304
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index c27ba25..ad188ce 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -225,6 +225,15 @@ handle the next calls to the API when required:
for item in items:
print(item.attributes)
+The generator exposes extra listing information as received by the server:
+
+* ``current_page``: current page number (first page is 1)
+* ``prev_page``: if ``None`` the current page is the first one
+* ``next_page``: if ``None`` the current page is the last one
+* ``per_page``: number of items per page
+* ``total_pages``: total number of pages available
+* ``total``: total number of items in the list
+
Sudo
====