2011-09-10 5 views
0

는 다음과 같은 모델을 고려하십시오.장고 모델 관련 분야 클래쉬

나는 다음과 같은 오류가 발생하고 데이터베이스를 동기화 할 때 : 나는 django 1.2.5pinax 0.7.2을 사용하고

(pinax-env)[email protected]:$ 
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'. 

.

이 문제를 해결하려면 어떻게해야합니까?

답변

0

문서의 답변을 찾았습니다. 구체적으로는 herehere입니다.

나는

author = models.ForeignKey(auth.models.User , null = False ,related_name="%(class)s_related_author") # The user who created 
editor = models.ForeignKey(auth.models.User , null = True,related_name="%(class)s_related_editor") # The user who last edited 
을 사용해야합니다