scholrly / neo4django

Drop-in Neo4j/Django integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Admin interface problem

ikresoft opened this issue · comments

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.

Are you setting a custom user model?

Yes.

Any resolution on this issue?

@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.

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.

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 :)

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

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