Reproduction steps:
- Create 3 nested models with its inline admin
class Top(models.Model):
name = models.CharField(max_length=128)
class Middle(models.Model):
top = models.ForeignKey(Top)
name = models.CharField(max_length=128)
class Bottom(models.Model):
middle = models.ForeignKey(Middle)
name = models.CharField(max_length=128)
class BottomInline(NestedStackedInline):
extra = 0
model = Bottom
class MiddleInline(NestedStackedInline):
model = Middle
extra = 0
inlines = [BottomInline]
class TopAdmin(NestedModel):
model = Top
inlines = [MiddleInline]
- Attempt to create a new Top object in django admin.
The Top model creation page has the name field and an empty group of Middle group with zero elements(expected)
But when you add a new Middle there is no Bottom group. (unexpected)
Only after saving one new Middle and re-editing the Top model again, Bottom Group will show (expected).
This does not happen with extra>0 in the BottomInline class
Django version 4.07
Reproduction steps:
The
Topmodel creation page has the name field and an empty group of Middle group with zero elements(expected)But when you add a new
Middlethere is noBottomgroup. (unexpected)Only after saving one new
Middleand re-editing theTopmodel again,BottomGroup will show (expected).This does not happen with extra>0 in the BottomInline class
Django version 4.07