3

Error that I have:

CommandError: One or more models did not validate:
comments.comment: Accessor for field 'content_type' clashes with related field 'ContentType.content_type_set_for_comment'. Add a related_name argument to the definition for 'content_type'.
comments.comment: Reverse query name for field 'content_type' clashes with related field 'ContentType.content_type_set_for_comment'. Add a related_name argument to the definition for 'content_type'.
comments.comment: Accessor for field 'site' clashes with related field 'Site.comment_set'. Add a related_name argument to the definition for 'site'.
comments.comment: Accessor for field 'user' clashes with related field 'User.comment_comments'. Add a related_name argument to the definition for 'user'.
comments.comment: Reverse query name for field 'user' clashes with related field 'User.comment_comments'. Add a related_name argument to the definition for 'user'.
comments.commentflag: Accessor for field 'user' clashes with related field 'User.comment_flags'. Add a related_name argument to the definition for 'user'.
comments.commentflag: Reverse query name for field 'user' clashes with related field 'User.comment_flags'. Add a related_name argument to the definition for 'user'.

In the beginning I installed newer app called django_comments, and did sync my database. But after I decided to use django-fluent-comments that need django.contrib.comments. So insteed of django_comments I put django.contrib.comments.

After I sync database my django project crashed with the error above.

So, please help to solve this problem or give me some recommendations.

Thanks for any advices!

PS: I tried to create new project with another virtualenvironment and changed mysql to sqlite3, but still have this error.

Simeon Visser
  • 118,920
  • 18
  • 185
  • 180
Shyngys Kassymov
  • 718
  • 11
  • 21
  • What version of Django do you use ? Did you custom your site or user model ? According to the error, it has nothing to do with your database, but only with Django models not validating (everytime you run a runserver/syncdb, ... command it validates the models) – Ricola3D Aug 08 '13 at 07:45
  • Sorry, but I found my mistake)) As you say it was in my models.py. There was some import from old app django_comments, so after I deleted this line everything start to work. Thanks for help. – Shyngys Kassymov Aug 08 '13 at 08:04

1 Answers1

1

I solved my problem. It was because I forgot to delete all imports in my models from old app django_comments. So now everything works fine!

Shyngys Kassymov
  • 718
  • 11
  • 21
  • Strange error messages for such an error. Well I guess this could be usefull to other Django users later, even if django.contrib.comments is now deprecated :) – Ricola3D Aug 08 '13 at 08:11