I am setting webservices for an application and I have the following models:
class Parent(models.Model):
...
class Child(models.Model):
parent = models.ForeignKey(Course)
...
The relation is One to Many (1 Parent, many Child) Now, I would like to get all the Parent objects with its particular Child and send it as JSON Request. Is it possible to do so without having to first get all the "Childs" and iterate them looking for the ones related to the particular parent? I think that would be extremely inefficient for really large databases, plus the "Childs" won't be repeated in other "Parents"
Thank you very much