Skip to content

Commit 11eadc9

Browse files
committed
Add some details in the docs for limit(None) and fetch_size()
1 parent 0f9eff3 commit 11eadc9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cassandra/cqlengine/query.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,14 +753,19 @@ class Automobile(Model):
753753

754754
def limit(self, v):
755755
"""
756-
Limits the number of results returned by Cassandra.
756+
Limits the number of results returned by Cassandra. Use *0* or *None* to disable.
757757
758758
*Note that CQL's default limit is 10,000, so all queries without a limit set explicitly will have an implicit limit of 10,000*
759759
760760
.. code-block:: python
761761
762+
# Fetch 100 users
762763
for user in User.objects().limit(100):
763764
print(user)
765+
766+
# Fetch all users
767+
for user in User.objects().limit(None):
768+
print(user)
764769
"""
765770

766771
if v is None:
@@ -782,7 +787,7 @@ def fetch_size(self, v):
782787
"""
783788
Sets the number of rows that are fetched at a time.
784789
785-
*Note that driver's default fetch size is 5000.
790+
*Note that driver's default fetch size is 5000.*
786791
787792
.. code-block:: python
788793

docs/api/cassandra/cqlengine/query.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The methods here are used to filter, order, and constrain results.
3232

3333
.. automethod:: limit
3434

35+
.. automethod:: fetch_size
36+
3537
.. automethod:: if_not_exists
3638

3739
.. automethod:: if_exists

0 commit comments

Comments
 (0)