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?