scholrly / neo4django

Drop-in Neo4j/Django integration.
GNU General Public License v3.0
358 stars 83 forks source link

Admin interface problem #226

Open ikresoft opened 10 years ago

ikresoft commented 10 years ago

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 commented 10 years ago

Are you setting a custom user model?

ikresoft commented 10 years ago

Yes.

skyleronken commented 10 years ago

Any resolution on this issue?

mhluongo commented 10 years ago

@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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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