对于m2m(ManyToManyField)的模型,我无法运行server。模型的字段本身如下:
...
class Some(TimeStampedModel):
relate = models.CharField(max_length=10000, blank=False)
related_relate = models.ManyToManyField('self', through='RelatedM2M',
symmetrical=False, related_name=_('related_relate'))
...
然后面临导入错误:
django.core.urlresolvers.NoReverseMatch: Reverse for 'related_phrases' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
我无法理解它是如何运作的......从this帖子我发现我需要create the reverse relationship manually yourself via the through model
但这意味着什么?究竟发生了什么,它会抛出这个错误以及如何处理与自己相关的模型中的m2m非对称字段?
更新的
django.core.urlresolvers.NoReverseMatch:
class NoReverseMatch(Exception):
pass
...