Not quite nested inlines?
- by Lynden Shields
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