summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-05-26 08:21:45 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-05-26 08:21:45 +0200
commit660f0cf546d18b28883e97c1182984593bbae643 (patch)
treed2ef09b1cd4ef987bbb2984fb528c8b7b1ee0b5c /docs/api-usage.rst
parentd9819042acde6cb30cbac3ef8f4fefa15a282459 (diff)
downloadgitlab-660f0cf546d18b28883e97c1182984593bbae643.tar.gz
Document the global per_page setting
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index 0882b21..4c57c29 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -189,6 +189,13 @@ parameter to get all the items when using listing methods:
all_groups = gl.groups.list(all=True)
all_owned_projects = gl.projects.owned(all=True)
+You can define the ``per_page`` value globally to avoid passing it to every
+``list()`` method call:
+
+.. code-block:: python
+
+ gl = gitlab.Gitlab(url, token, per_page=50)
+
``list()`` methods can also return a generator object which will handle the
next calls to the API when required. This is the recommended way to iterate
through a large number of items: