Question

So, I'm looking into the Django and Neo4j integration, but there's not much about it out there ... What I want to know is if I have a model like the one here: If I want to add a new property to a model, it would be as simple as doing:

node.setProperty( "newProperty", "something" );

??

Moreover, all the queries in django would work ? How is the traversing made ?

I would appreciate any response :D

Thanks.

Was it helpful?

Solution

We've been working on updating the Neo4j/Django integration to work with neo4j-rest-client - the fruits of our labor are on GitHub, with some quick comments on my blog.

There are some pros and cons to our integration. The most obviously impacting is our use of a REST client- you get to use a remote database, while losing quite a bit, performance-wise. OTOH, the integration works alongside a relational database, so you can still use django.contrib stuff that relies on the original ORM, and it handles indexing and query sets pretty nicely.

To do what you want above using neo4django, you'd simply get the neo4j-rest-client based node from the model instance, and have at it.

model_instance.node['newProperty'] = 'something'

We're still cranking on making the integration more dynamic, supporting traversals/etc in a Pythonic way, and (currently most important) improving the performance. If you're interested, I'd love feedback.

OTHER TIPS

Have you seen Tobias's blog post about Django integration? It's kinda old now, but still relevant. Plus there are examples you can check out too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top