diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-26 08:21:45 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-26 08:21:45 +0200 |
commit | 660f0cf546d18b28883e97c1182984593bbae643 (patch) | |
tree | d2ef09b1cd4ef987bbb2984fb528c8b7b1ee0b5c /docs/api-usage.rst | |
parent | d9819042acde6cb30cbac3ef8f4fefa15a282459 (diff) | |
download | gitlab-660f0cf546d18b28883e97c1182984593bbae643.tar.gz |
Document the global per_page setting
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r-- | docs/api-usage.rst | 7 |
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: |