mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[3.2.x] Fixed #33046 -- Added note about using length of cached result by QuerySet.count().
Backport of 7ea86076fc1128d43b47f4826cb25eb5ebb19f19 from main
This commit is contained in:
parent
d95a0144e5
commit
69009f4952
@ -2292,6 +2292,9 @@ retrieving model instances from it (for example, by iterating over it), it's
|
|||||||
probably more efficient to use ``len(queryset)`` which won't cause an extra
|
probably more efficient to use ``len(queryset)`` which won't cause an extra
|
||||||
database query like ``count()`` would.
|
database query like ``count()`` would.
|
||||||
|
|
||||||
|
If the queryset has already been fully retrieved, ``count()`` will use that
|
||||||
|
length rather than perform an extra database query.
|
||||||
|
|
||||||
``in_bulk()``
|
``in_bulk()``
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user