考虑以下模型:
class FPModel(models.Model):
# The user who created
author = models.ForeignKey(auth.models.User, null=False)
# The user who last edited
editor = models.ForeignKey(auth.models.User, null=True)
# Create Time
created_at = models.DateTimeField(auto_now_add=True)
# Modify Time
edited_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
我将自动填充django admin。
中的作者和编辑器字段当我同步数据库时,我收到以下错误:
(pinax-env)gautam@Aspirebuntu:$
python manage.py syncdb
Error: One or more models did not validate:
FP.fpmodel: Accessor for field 'author' clashes with related field 'User.fpmodel_set'. Add a related_name argument to the definition for 'author'.
FP.fpmodel: Accessor for field 'editor' clashes with related field 'User.fpmodel_set'. Add a related_name argument to the definition for 'editor'.
我正在使用django 1.2.5
和pinax 0.7.2
。
我该怎么做才能解决这个问题?
答案 0 :(得分:0)