scholrly / neo4django

Drop-in Neo4j/Django integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RelationshipInstance.get_or_create()

tonjo opened this issue · comments

Creating a related model with a get_or_create() on relationships.
Example (by Matt himself):

pete = patrick.friends.get_or_create(name='Pete')

Create a new person "Pete" and connect to patrick.

I should have specified, create a new Person or find one if exists.

Thanks for raising this @tonjo, I'm going to try to get it in this coming release.

I've started a campaign to fund the completion of this release, including this issue and Django 1.5+ support. Check it out at https://www.bountysource.com/fundraisers/423-neo4django-0-1-9 if you're interested.