Skip to content

Commit 29e2efe

Browse files
author
Gauvain Pocentek
committed
docs: improve the pagination section
1 parent 47cb278 commit 29e2efe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/api-usage.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,28 @@ actions on the GitLab resources. For example:
106106
Pagination
107107
==========
108108

109-
You can use pagination to go throught long lists:
109+
You can use pagination to iterate over long lists. All the Gitlab objects
110+
listing methods support the ``page`` and ``per_page`` parameters:
110111

111112
.. code-block:: python
112113
113114
ten_first_groups = gl.groups.list(page=0, per_page=10)
114115
115-
Use the ``all`` parameter to get all the items when using listing methods:
116+
By default GitLab does not return the complete list of items. Use the ``all``
117+
parameter to get all the items when using listing methods:
116118

117119
.. code-block:: python
118120
119121
all_groups = gl.groups.list(all=True)
120122
all_owned_projects = gl.projects.owned(all=True)
121123
124+
.. note::
125+
126+
python-gitlab will iterate over the list by calling the correspnding API
127+
multiple times. This might take some time if you have a lot of items to
128+
retrieve. This might also consume a lot of memory as all the items will be
129+
stored in RAM.
130+
122131
Sudo
123132
====
124133

0 commit comments

Comments
 (0)