Hi,
I would like to query an object from a DB and fetch all nested objects.
For example:
class ModelA(models.Model):
...
class ModelB(models.Model):
a = models.ForeignKey(ModelA)
...
class ModelC(models.Model):
b = models.ForeignKey(ModelB)
...
I want to query C by it's ID and to eagerly fetch A and B:
ModelC.objects.filter(pk=id).select_related('b')
But how to I do it when I want to already fetch also a when I call c.b?
Thank you