scholrly / neo4django

Drop-in Neo4j/Django integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Models can override eachother's reverse relationships

mhluongo opened this issue · comments

For example,

class Person(NodeModel):
     class Meta:
         abstract = True
     friends = model.Relationship('Person', ...)

class SubPerson1(NodeModel):
    pass

class SubPerson2(NodeModel):
    pass

Now, explore a bit

>>> Person.friends.target_model

You'll see it's SubPerson2. This is a problem, because the only friends a regular Person instance will have when you call person.friends.all() will be SubPerson2 instances.