Re: Multiple conditions on same field in JOIN over three models
On 12/17/2010 08:21 PM, Javier Guerra Giraldez wrote:
> Blog.objects.filter(post__tags__name="foo").filter(post__tags__name="bar")
That's "get all blogs that have at least one post tagged with 'foo' and
one post tagged with 'bar'", not requiring that *one post* matches
*both* conditions.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home