name = models.CharField(max_length='20',blank=True)
I want to get the result of Child.objects.all() but I DO NOT want to
I want to use Parent instead, which I tried to do with:
Which doesn't work and gives the result of Product.objects.all()
However If I do the following, it WORKS:
Another way, if I insist on using
Parent.objects.filter(child__isnull=False), is to change the Child
model to the following:
parent = models.OneToOneField(Parent)
Then Parent.objects.filter(child__isnull=False) would WORK
The problem with the 2 solutions above is that filtering with
child__name__isnull looks hackish, and I don't want to change my Child
model to use OneToOneField.
So is there a better way?