class One(models.Model):
image = models.ImageField()
class Two(models.Model):
one = models.ForeignKey(One,on_delete=models.CASCADE)
three = models.ForeignKey(Three,on_delete=models.CASCADE)
class Three(models.Model):
pass
class TwoInline(admin.TabularInline):
model = Two
@admin.register(Three)
class ThreeAdmin(admin.ModelAdmin):
inlines = [TwoInline]