class Products(models.Model):
name = models.CharField(max_length=50)
leve1 = models.ForeignKey( Level1 )
leve2 = models.ForeignKey( Level2 )
leve3 = models.ForeignKey( Level3 )
leve4 = models.ForeignKey( Level4 )
class Level1(models.Model):
name = models.CharField(max_length=50)
class Level2(models.Model):
name = models.CharField(max_length=50)
leve1 = models.ForeignKey( Level1 )
class Level3(models.Model):
name = models.CharField(max_length=50)
leve2 = models.ForeignKey( Level2 )
class Level4(models.Model):
name = models.CharField(max_length=50)
leve3 = models.ForeignKey( Level3 )
Django Admin で、別の選択ボックスに基づいて選択ボックスの値を調整する
formfield_for_foreignkey を使用しますか? raw_id_fields?