1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #24141 -- Added QuerySet.contains().

This commit is contained in:
Johan Schiff
2020-06-09 11:23:31 +02:00
committed by Mariusz Felisiak
parent 286fb73b69
commit d01709aae2
7 changed files with 132 additions and 18 deletions

View File

@@ -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()``
------------------------