Displaying the other side of Foreign Key Relations

30 views
Skip to first unread message

Jackson Newhouse

unread,
Jan 8, 2013, 8:00:49 PM1/8/13
to django-res...@googlegroups.com
I'm working off of a production database, and as such have limited ability to change the database structure. The models look like

class Parent(models.Model):
    name = models.charField(max_length=100)

class Child(modles.Model):
    name=models.CharField(max_length=100)
    parent = models.ForeignKey(Parent)

How can I get my serializers or views to display all of the children a parent has on the Parent's page. Django constructs something called child_set, and this is what I want to see. Can't seem to figure it out though.

Thanks,
    Jack
Reply all
Reply to author
Forward
0 new messages