Chris Moffitt wrote: <snip> > If I try this: >item1.sub_item_set.filter(options__name__exact="Small").filter(options__name__exact="Blue") > I get an empty list. > > I've tried this using Q objects and some other things but I can't get it > to work. Anyone have ideas of what I'm doing wrong? >
Try going into the interactive interpretter (python manage.py shell) and importing your models, then try: query=item1.sub_item_set.filter(options__name__exact="Small").filter(options__name__exact="Blue") then inspect the resulting SQL query components by executing: print query._get_sql_clause() Review it to make sure the underlying select looks like what you expect it should. -- William --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---

