On 9/16/06, Tom Smith <[EMAIL PROTECTED]> wrote: > > Recipe.objects.exclude(category__in=words) > > ...which is great, but now having set words to and empty list [] I > get the error...
This is an issue that has been previously reported: http://code.djangoproject.com/ticket/2473 > So... would it be possible to do this? > > ...or would the first line go off and get all the objects (I have > about a million records)? Query sets are not executed on the database until you iterate, or otherwise try to extract data from them. o = Recipe.objects o2 = o.filter(xx) o3 = o2.filter(yy) o4 = o3.filter(zz) print o4 will result in just 1 query getting issued to the database - the final query with three filters. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---