diff options
| author | Johan Schiff <johan@radkompaniet.se> | 2020-06-09 11:23:31 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-06 20:40:29 +0100 |
| commit | d01709aae21de9cd2565b9c52f32732ea28a2d98 (patch) | |
| tree | 83326f30469fb3dda431362dea3adfd6e058f85f /docs/topics | |
| parent | 286fb73b6962d197ed0cf041755fb724cfe08600 (diff) | |
Fixed #24141 -- Added QuerySet.contains().
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/db/optimization.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index 69eb58212a..180cd60a46 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -240,6 +240,12 @@ row in the results, even if it ends up only using a few columns. The lot of text data or for fields that might take a lot of processing to convert back to Python. As always, profile first, then optimize. +Use ``QuerySet.contains(obj)`` +------------------------------ + +...if you only want to find out if ``obj`` is in the queryset, rather than +``if obj in queryset``. + Use ``QuerySet.count()`` ------------------------ |
