Not quite nested inlines?
Posted
by
Lynden Shields
on Stack Overflow
See other posts from Stack Overflow
or by Lynden Shields
Published on 2012-11-12T04:49:21Z
Indexed on
2012/11/12
5:00 UTC
Read the original article
Hit count: 112
django
|django-admin
Not quite sure what to call this, it's not quite nested inlines, but is probably related.
I have a 3 level hierarchy of objects, A one-to-many B one-to-many C. Therefore, every C implicitly also belongs to an A.
class A(models.Model):
stuff = models.CharField("Stuff", max_length=50)
class B(models.Model):
a = models.ForeignKey(A)
class C(models.Model):
b = models.ForeignKey(B)
I would like all C's that belong to an A to be listed on the admin page for A in an in-line. They do not have to show which B they belong to on the same page.
Is this possible or is it the same problem as nested inlines anyway? If it's possible, how do I do it?
I'm using django 1.3
© Stack Overflow or respective owner