【发布时间】:2017-12-20 17:24:16
【问题描述】:
我有我的 models.py
class TaggedActionsBefore(GenericTaggedItemBase):
tag = models.ForeignKey(Tag, related_name="%(class)s_emotionsbefore")
class TaggedActionsAfter(GenericTaggedItemBase):
tag = models.ForeignKey(Tag, related_name="%(class)s_emotionsafter")
class ActionJournal(models.Model):
situation = models.TextField()
actions_before = TaggableManager(blank=True, through=TaggedActionsBefore, help_text="")
actions_after = TaggableManager(blank=True, through=TaggedActionsAfter, related_name="actionsafter", help_text="")
我在尝试保存标签时收到以下错误
get() returned more than one Tag -- it returned 2!
通过一个表单,它是ActionJournal 模型的模型表单。 请让我知道我做错了什么。
【问题讨论】:
标签: django django-taggit