> filterList = accounts.objects.filter(name="foo", company="bar", blah blah blah..) > > itemsList = items.objects.filter(account__in=accountList, status="delivered", andSo="on"....) > >
Not sure if I understand it correctly, but shouldn't this work better? items list=items.objects.filter(status="delivered",account__name="foo",account__company="bar",account__blah blah...) If you want to separate where in the code you set the 'account' criteria from the 'items' ones, simply pass a dictionary with the arguments for the first .filter() and prep end 'account__' to all the keys before feeding to the items.objects.filter() call. -- Javier -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.