mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #24141 -- Added QuerySet.contains().
This commit is contained in:
parent
286fb73b69
commit
d01709aae2
7 changed files with 132 additions and 18 deletions
|
@ -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()``
|
||||
------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue