#4849: Nested Filters
-------------------------------------+--------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Database wrapper
Version: SVN | Resolution:
Keywords: filter, foreignkey | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------------------+--------------------------------------
Comment (by [EMAIL PROTECTED]):
As you said, {{{Article.objects.filter(tags=t2, tags=t1)}}} won't work
because you can't pass duplicate keyword arguments for "tags". For this
you could use:
{{{
>>> Article.objects.filter(tags__in=(t1, t2)).distinct()
[<Article: A1>, <Article: A2>]
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/4849#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---