Skip to content

Commit a65db2c

Browse files
committed
docs: cover experimental pagination using _next field
1 parent 08545eb commit a65db2c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/usage/querying.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,23 @@ these parameters by the method `custom(name: str, value: str)`.
154154
155155
employees = northwind.entity_sets.Employees.get_entities().custom('sap-client', '100').custom('$skiptoken', 'ABCD').top(10).execute()
156156
157+
158+
159+
(Experimental) Query server-side paginations using the __next field
160+
-------------------------------------------------------------------
161+
Response may contains ony partial listings of the Collection. In this case, "__next" name/value
162+
pair is included, where the value is a URI which identifies the next partial set of entities.
163+
164+
165+
.. code-block:: python
166+
employees = northwind.entity_sets.Employees.get_entities().select('EmployeeID,LastName').execute()
167+
while True:
168+
for employee in employees:
169+
print(employee.EmployeeID, employee.LastName)
170+
171+
# Stop if server has no more entities left
172+
if employees.next_url is None:
173+
break
174+
175+
# We got a partial answer - continue with next page
176+
employees = northwind.entity_sets.Employees.get_entities().next_url(employees.next_url).execute()

0 commit comments

Comments
 (0)