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

Admin interface problem #226

Open
ikresoft opened this issue Nov 16, 2013 · 8 comments
Open

Admin interface problem #226

ikresoft opened this issue Nov 16, 2013 · 8 comments

Comments

@ikresoft
Copy link

When I want to turn on admin in django like in neo4django docs I get this error:
admin.logentry: Reverse query name for field 'user' clashes with field 'User.logentry'. Add a related_name argument to the definition for 'user'.

I am using django 1.5.4 and neo4j 1.9.5.

@mhluongo
Copy link
Member

Are you setting a custom user model?

@ikresoft
Copy link
Author

Yes.

@skyleronken
Copy link

Any resolution on this issue?

@mhluongo
Copy link
Member

@skyleronken are you seeing this as well? I wasn't able to replicate it, but if I had a minimal project showing the issue I could take a crack at it.

@skyleronken
Copy link

Yeah, I have the same issue. The Error:

CommandError: One or more models did not validate:
admin.logentry: Reverse query name for field 'user' clashes with field 'User.logentry'. Add a related_name argument to the definition for 'user'.

Django 1.5.4, Repo pull of neo4django

Admin related code is as follows:

https://gist.github.com/skyleronken/8496526

Let me know if more is needed.

@skyleronken
Copy link

I managed to get this error to go away by editing the following line in admin/models.py:

class LogEntry(models.NodeModel):
...
user = models.Relationship(User, rel_type='completed_by',related_name='completed_by', single=True)
...

Not sure if that truly fixes anything, but the error is gone and im on to working on another one that does not seem to be related :)

@meatballs
Copy link
Contributor

I've tried using neo4django for the first time today and hit this problem.

Using virtualenv, I installed neo4django (from the github repo rather than 0.1.8) and it then downloaded django 1.5.5

I created one app with a very simple model and the followed the instructions on the docs to get the admin interface working.

I've pushed my work so far to https://github.com/meatballs/django_neo4j

@meatballs
Copy link
Contributor

skyleronken's solution worked for me too. I'll create a pull request for this issue

mhluongo added a commit that referenced this issue Feb 12, 2014
Adds related_name to user in LogEntry class #226
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

4 participants