Kaydet (Commit) 11bfe3a8 authored tarafından Christian Ledermann's avatar Christian Ledermann Kaydeden (comit) Tim Graham

Refs #29493 -- Doc'd that the QuerySet in lookup accepts a string.

üst 78972af3
...@@ -2622,15 +2622,18 @@ SQL equivalent:: ...@@ -2622,15 +2622,18 @@ SQL equivalent::
``in`` ``in``
~~~~~~ ~~~~~~
In a given iterable; often a list, tuple, or queryset. In a given iterable; often a list, tuple, or queryset. It's not a common use
case, but strings (being iterables) are accepted.
Example:: Examples::
Entry.objects.filter(id__in=[1, 3, 4]) Entry.objects.filter(id__in=[1, 3, 4])
Entry.objects.filter(headline__in='abc')
SQL equivalent:: SQL equivalents::
SELECT ... WHERE id IN (1, 3, 4); SELECT ... WHERE id IN (1, 3, 4);
SELECT ... WHERE headline IN ('a', 'b', 'c');
You can also use a queryset to dynamically evaluate the list of values You can also use a queryset to dynamically evaluate the list of values
instead of providing a list of literal values:: instead of providing a list of literal values::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment