我的所有ManyToMany都显示在我的管理员表单中,但使用through
时自定义的除外;
原始模型字段
class Action(models.Model):
combo_action = models.ForeignKey('Action', related_name = '+', blank = True, null = True, through = 'Action_Effects')
combo_bonus_effects = models.ManyToManyField('Effect', related_name = 'ComboInflicted', through = 'Action_Combo_Effects')
参考模型
class Action_Effects(models.Model):
action = models.ForeignKey('Action')
effect = models.ForeignKey('Effect')
duration = models.IntegerField(blank = True, null = True)
combo_potency = models.IntegerField(blank = True, null = True)
class Action_Combo_Effects(models.Model):
action = models.ForeignKey('Action')
effect = models.ForeignKey('Effect')
duration = models.IntegerField(blank = True, null = True)
combo_potency = models.IntegerField(blank = True, null = True)
我找不到显示这些的方法。