django admin manytomany手动指定关系映射报错
admin后台报错
(admin.E013) The value of 'fields' cannot include the ManyToManyField 'drugIndication', because that field manually specifies a relationship model.
多对多关系定义为:
class drugInfo(models.Model):
drugIndication = models.ManyToManyField('indicationCategory',through='drugIndication', blank=True)
关系类定义:
class drugIndication(models.Model):
id = models.UUIDField('关联id', primary_key=True, default=uuid.uuid1, editable=False)
drugInfoId = models.ForeignKey(drugInfo,on_delete=models.CASCADE,blank=True,null=True)
indicationCategoryId = models.ForeignKey(indicationCategory,on_delete=models.CASCADE,blank=True,null=True)
大神们,帮忙看看啥问题