每当我尝试添加新标记时,都会遇到此错误。我试着去谷歌并阅读一些SO帖子,但对我来说没什么用。
以下是我的2个型号:
摘要:
class Summary(models.Model):
question_text = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
url = models.URLField(null=False)
cover_image = models.CharField(max_length=255)
tags = models.ManyToManyField('Tag', related_name='summaries', blank=True)
userProfileSummary = models.ManyToManyField('UserProfile', through='UserProfileSummary')
def __str__(self):
return self.question_text
class Meta:
verbose_name_plural = "Summaries"
标签:
class Tag(models.Model):
name = models.CharField(max_length=255)
description = models.TextField(null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.name
模型/的初始化的.py:
...
from .tag import Tag
from .summary import Summary
__all__ = (
...
'Tag',
'Summary',
)
拜托,我错过了什么?