Re: Comparing ManyToMany fields

2009-12-27 Thread Scott Maher
akaariai wrote: > This is not the easiest query to perform using SQL. Something like the > following query might work, I have tested it only quickly. > > select t2.pizza_id > from (select pizza_id from pizza_toppings group by pizza_id >having count(*) = (select count(*) from pizza_toppings wher

Re: Comparing ManyToMany fields

2009-12-27 Thread akaariai
On 27 joulu, 11:32, Scott Maher wrote: > Is it possible to filter by the ManyToMany fields? > > Suppose I have a Pizza model and a Topping model. Topping has a > ManyToManyField pointing to Pizza. I now have an instance of a Pizza > called mypizza. > > I would like to now search for all Pizzas w

Re: Comparing ManyToMany fields

2009-12-27 Thread Michael Jenkinson
: django-users@googlegroups.com Sent: Sun, December 27, 2009 9:32:22 AM Subject: Comparing ManyToMany fields Is it possible to filter by the ManyToMany fields? Suppose I have a Pizza model and a Topping model. Topping has a ManyToManyField pointing to Pizza. I now have an instance of a Pizza called

Comparing ManyToMany fields

2009-12-27 Thread Scott Maher
Is it possible to filter by the ManyToMany fields? Suppose I have a Pizza model and a Topping model. Topping has a ManyToManyField pointing to Pizza. I now have an instance of a Pizza called mypizza. I would like to now search for all Pizzas with the EXACT same Toppings as mypizza. Intuitively