Ticket #10947: 10947.diff
File 10947.diff, 647 bytes (added by , 15 years ago) |
---|
-
ref/models/querysets.txt
1295 1295 1296 1296 values = Blog.objects.filter( 1297 1297 name__contains='Cheddar').values_list('pk', flat=True) 1298 entries = Entry.objects.filter(blog__in= values)1298 entries = Entry.objects.filter(blog__in=list(values)) 1299 1299 1300 Note the ``list()`` call around the Blog ``QuerySet`` to force execution of 1301 the first query. Without it, a nested query would be executed since 1302 :ref:`querysets-are-lazy`. 1303 1300 1304 gt 1301 1305 ~~ 1302 1306