querysets: if x in y

2009-11-08 Thread Edward McCaughan
I have a complicated query set to do, does anyone have any suggestions on the least insane way to do it? I need to merge two querysets and only get out ones with a common field: ModelOne.objects.filter(x=whatever) ModelTwo.objects.filter(y=foo) both of these objects have a property which is a d

Re: querysets: if x in y

2009-11-08 Thread Edward McCaughan
.objects.filter(name=["toast","bread","shoes"]) since in this case, the lookup to get the list wouldn't be too expensive and could be cached edward On Nov 8, 11:56 pm, Edward McCaughan wrote: > I have a complicated query set to do, does anyone have any sugge