Say I have 2 classes as:
class Bar(models.Model):
prop = IntegerField()
class Foo(models.Model):
bar = ManyToManyField(Bar)
I want to return a QuerySet containing model instances of bar that match the query:
QuerySetOfFoos.objects.filter(bar__prop__gt=0)
Is there an easy way to do this? I know that in the model instance I could do foo.bar_set but not sure how to do it over all of the original QuerySet...