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
This commit is contained in:
Adrian Holovaty 2010-01-10 17:25:44 +00:00
parent 665ac8779b
commit ddd6f28cac
1 changed files with 5 additions and 1 deletions

View File

@ -1317,7 +1317,11 @@ extract two field values, where only one is expected::
values = Blog.objects.filter(
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
~~