I have a query like:
Product.objects.filter(categories__in=cat_ids).distinct()

where categories is a m2m field.

As I understand it this loads products which have belong to ANY of the
categories in cat_ids

How would I load only products which belong to ALL of the categories
in cat_ids?

(is this possible in ORM?)

I think in SQL you'd have to change the one IN clause to a series of
ANDs

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to