Neo4j 和 django 模型
所以,我正在研究 Django 和 Neo4j 集成,但是关于它的信息并不多......我想知道的是我是否有一个像这里这样的模型: 如果我想向模型添加新属性,那么就像执行以下操作一样简单:
node.setProperty( "newProperty", "something" );
??
此外,django 中的所有查询都可以工作吗?遍历是如何进行的?
如果有任何回复,我将不胜感激 :D
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们一直致力于更新 Neo4j/Django 集成,以便与 neo4j-rest-client - 我们的劳动成果在 GitHub 上,并对我的博客。
我们的整合有一些优点和缺点。最明显的影响是我们对 REST 客户端的使用 - 您可以使用远程数据库,但在性能方面会损失相当多。 OTOH,集成与关系数据库一起工作,因此您仍然可以使用依赖于原始 ORM 的 django.contrib 内容,并且它可以很好地处理索引和查询集。
要使用 neo4django 执行上述操作,您只需从模型实例中获取基于 neo4j-rest-client 的节点,然后使用它即可。
我们仍在努力使集成更加动态,以 Pythonic 方式支持遍历等,并(目前最重要的)提高性能。如果您有兴趣,我很乐意提供反馈。
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.
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.
您是否看过 Tobias 的博客有关 Django 集成的帖子 ?现在有点旧了,但仍然有意义。另外还有示例您可以查看也。
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.