Hi (sorry for my bad english :p)
Imagine these models :
class Fruit(models.Model):
# ...
class Basket(models.Model):
fruits = models.ManyToManyField(Fruit)
Now I would like to retrieve Basket instances related to all fruits. The problem is that the code bellow returns Basket instances related to any fruits :
baskets = Basket.objects.filter(fruits__in=Fruit.objects.all())
# This doesn't work:
baskets = Basket.objects.filter(fruits=Fruit.objects.all())
Any solution do resolve this problem ?
Thank you very much. :)