Hye, Am Ian, working on a project... Trying to inco-operate the app to my django project...
I was doing testing, and the following error is shown:
Error: One or more models did not validate:
auth.user: Accessor for m2m field 'relationships' clashes with related m2m field 'User.related_to'. Add a related_name argument to the definition for 'relationships'.
auth.user: Reverse query name for m2m field 'relationships' clashes with related m2m field 'User.related_to'. Add a related_name argument to the definition for 'relationships'.
auth.user: The model User has two manually-defined m2m relations through the model Relationship, which is not permitted. Please consider using an extra field on your intermediary model instead.
auth.user: Accessor for m2m field 'relationships' clashes with related m2m field 'User.related_to'. Add a related_name argument to the definition for 'relationships'.
auth.user: Reverse query name for m2m field 'relationships' clashes with related m2m field 'User.related_to'. Add a related_name argument to the definition for 'relationships'.
I believe it has to something with the hack you have in models.py file:
HACK
field = models.ManyToManyField(User, through=Relationship, symmetrical=False, related_name='related_to')
TODO: Look into this issue; Remove The comment below after Tests #field.contribute_to_class(User, 'relationships')
I thought I could avoid the issue by commenting out the parts, but, I get a diffent error altogether :
ERROR: test_site_behavior (relationships.tests.tests.RelationshipsTestCase)
Traceback (most recent call last):
File "/home/ian/workspace/myproject/src/myproject/util/core/relationships/tests/tests.py", line 231, in test_site_behavior
self.assertQuerysetEqual(self.walrus.relationships.all(), [self.john, self.paul])
File "/usr/lib/pymodules/python2.6/django/db/models/manager.py", line 117, in all
return self.get_query_set()
File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py", line 484, in get_query_set
return superclass.get_query_set(self).using(db).next_is_sticky().filter(*(self.core_filters))
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 550, in filter
return self._filter_or_exclude(False, *args, *_kwargs)
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 568, in _filter_or_exclude
clone.query.add_q(Q(_args, *_kwargs))
File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py", line 1128, in add_q
can_reuse=used_aliases)
File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py", line 1026, in add_filter
negate=negate, process_extras=process_extras)
File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py", line 1191, in setup_joins
"Choices are: %s" % (name, ", ".join(names)))
FieldError: Cannot resolve keyword 'related_to' into field. Choices are: _message_set, avatar, date_joined, email, emailvalidation, first_name, forum_post_set, from_users, groups, id, is_active, is_staff, is_superuser, last_login, last_name, logentry, originating_user, password, rate, reputation, subscription, target_user, to_users, user_permissions, username, vote
Please check this out... Cheers.