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?