Kaydet (Commit) ddd6f28c authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #10947 -- Fixed error in __in documentation. Thanks, julianb and timo

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12163 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 665ac877
...@@ -1317,7 +1317,11 @@ extract two field values, where only one is expected:: ...@@ -1317,7 +1317,11 @@ extract two field values, where only one is expected::
values = Blog.objects.filter( values = Blog.objects.filter(
name__contains='Cheddar').values_list('pk', flat=True) name__contains='Cheddar').values_list('pk', flat=True)
entries = Entry.objects.filter(blog__in=values) entries = Entry.objects.filter(blog__in=list(values))
Note the ``list()`` call around the Blog ``QuerySet`` to force execution of
the first query. Without it, a nested query would be executed, because
:ref:`querysets-are-lazy`.
gt gt
~~ ~~
......
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