diff options
| author | Can Sarıgöl <ertugrulsarigol@gmail.com> | 2021-08-25 13:44:08 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-08-26 09:05:35 +0200 |
| commit | 69009f495232dbab7ec02b908fefa67147c76d64 (patch) | |
| tree | 813bb618a003628e3e708180498321c9131e9fe0 /docs | |
| parent | d95a0144e532f6ad30c0840b723f6d3928e6d1ad (diff) | |
[3.2.x] Fixed #33046 -- Added note about using length of cached result by QuerySet.count().
Backport of 7ea86076fc1128d43b47f4826cb25eb5ebb19f19 from main
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 4aeb8c944c..6ff63f01e5 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -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 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()`` ~~~~~~~~~~~~~ |
