Django自定义ManyToMany字段不会显示在管理员中

时间:2013-06-16 20:57:18

标签: django

我的所有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)

我找不到显示这些的方法。

0 个答案:

没有答案