mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24141 -- Added QuerySet.contains().
This commit is contained in:
committed by
Mariusz Felisiak
parent
286fb73b69
commit
d01709aae2
@@ -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()``
|
||||
------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user