Skip to content

Commit 660f0cf

Browse files
author
Gauvain Pocentek
committed
Document the global per_page setting
1 parent d981904 commit 660f0cf

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/api-usage.rst

+7
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ parameter to get all the items when using listing methods:
189189
all_groups = gl.groups.list(all=True)
190190
all_owned_projects = gl.projects.owned(all=True)
191191
192+
You can define the ``per_page`` value globally to avoid passing it to every
193+
``list()`` method call:
194+
195+
.. code-block:: python
196+
197+
gl = gitlab.Gitlab(url, token, per_page=50)
198+
192199
``list()`` methods can also return a generator object which will handle the
193200
next calls to the API when required. This is the recommended way to iterate
194201
through a large number of items:

docs/cli.rst

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ parameters. You can override the values in each GitLab server section.
7171
* - ``api_version``
7272
- ``3`` ou ``4``
7373
- The API version to use to make queries. Requires python-gitlab >= 1.3.0.
74+
* - ``per_page``
75+
- Integer between 1 and 100
76+
- The number of items to return in listing queries. GitLab limits the
77+
value at 100.
7478

7579
You must define the ``url`` in each GitLab server section.
7680

0 commit comments

Comments
 (0)