Neo4j and django models

前端 未结 2 940
旧时难觅i
旧时难觅i 2020-12-10 05:42

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 t

相关标签:
2条回答
  • 2020-12-10 06:24

    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.

    0 讨论(0)
  • 2020-12-10 06:39

    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.

    0 讨论(0)
提交回复
热议问题