Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django-relationships: RelationshipStatus matching query doesnt exist #46

Open
shubhammulay opened this issue Nov 30, 2014 · 2 comments
Open

Comments

@shubhammulay
Copy link

I am using django-relationships for the system of followers and following in my django app. I followed the documentation and added the app 'relationships' in my INSTALLED_APPS. And after it by running 'python manage.py shell' ,I did the following according to the documentation

>>> john = User.objects.get(username='john')
>>> rel = john.relationships.add(jane)

But the problem is :

Traceback (most recent call last):
File "<console>", line 1, in <module>
File "build/bdist.macosx-10.7-intel/egg/relationships/models.py", line 96, in add
  status = RelationshipStatus.objects.following()
File "build/bdist.macosx-10.7-intel/egg/relationships/models.py", line 13, in following
  return self.get(from_slug='following')
File "/Library/Python/2.7/site-packages/django/db/models/manager.py", line 132, in get
  return self.get_query_set().get(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/db/models/query.py", line 349, in get
  % self.model._meta.object_name)
DoesNotExist: RelationshipStatus matching query does not exist.

I also copied the folder of django-relationships in my main project folder but it didnt work. Do I have to manually create relationshipstatuses ? How to do it ? Or what is other solution for it ? Thanks!

@carpincho
Copy link

Add the app in the INSTALLED_APPS not the sourcecode.
Have you created your tables?
Before running shell you need to create the tables related to the app.
Try executing:
python manage.py makemigrations
python manage.py migrate

@shubhammulay
Copy link
Author

I have added the app in "INSTALLED_APPS".I also tried you second step.But it aint working.It says "RelationshipStatus matching query does not exist." Tables have been created.The problem is that they are empty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@carpincho @shubhammulay and others