neo4django

Create REST API with Neo4J and Django

倖福魔咒の 提交于 2020-01-24 03:36:21
问题 I am trying to create a REST API with Neo4j and Django in the backend. The problem is that even when I have Django models using Neo4Django , I can't use frameworks like Tastypie or Piston that normally serialize models into JSON (or XML). Sorry if my question is confusing or not clear, I am newbie to webservices. Thanks for you help EDIT: So I started with Tastypie and followed the tutorial on this page http://django-tastypie.readthedocs.org/en/latest/tutorial.html . I am looking for

`objects.get(…)` does not work as expected

大憨熊 提交于 2020-01-15 15:39:09
问题 I'm trying to get an object from my neo4j database using neo4django >>> # There is a single Person object in the database, so I get a value >>> slug=Person.objects.get().name_slug >>> print(slug) doe-john >>> # ok, it's there >>> p=Person.objects.get(name_slug=slug) Traceback (most recent call last): File "<console>", line 1, in <module> File "/[...]/src/neo4django/neo4django/db/models/manager.py", line 37, in get return self.get_query_set().get(*args, **kwargs) File "/[...]/lib/python2.7

neo4django mixin inheritance problems

拜拜、爱过 提交于 2019-12-14 04:21:06
问题 Considering my previous question, I try to implement what I need. The following is the content of a django app models.py. from neo4django.db import models from neo4django.auth.models import User as AuthUser class MyManager(models.manager.NodeModelManager): def filterLocation(self,**kwargs): qs = self.get_query_set() if 'dist' in kwargs: qs = qs.filter(_where_dist=kwargs['dist']) elif 'prov' in kwargs: qs = qs.filter(_where_prov=kwargs['prov']) elif 'reg' in kwargs: qs = qs.filter(_where_reg

Why does the cleandb extension refuse to delete my neo4j graph database?

半城伤御伤魂 提交于 2019-12-11 12:18:59
问题 When trying to purge neo4j (1.8.2) with the cleandb extension (for neo4j 1.8), it fails: [path] ? curl -v -X DELETE 'http://localhost:7475/db/cleandb/12sE$lkj3%' * About to connect() to localhost port 7475 (#0) * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 7475 (#0) > DELETE /db/cleandb/12sE$lkj3% HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:7475 > Accept: */* > < HTTP/1.1 500 Internal Server Error < Content-Length: 0 < Server: Jetty(6.1.25) < * Connection #0 to host

neo4django multiple inheritance

做~自己de王妃 提交于 2019-12-11 12:07:27
问题 I was trying to create my model MyUser extending neo4django.auth.models.User, so I can use the underlying authentication system. The problem is I want create also a superclass from which derive many methods and attributes that are very common for my different kind of nodes. I did this: from neo4django.auth.models import User as AuthUser class MyBaseModel(models.NodeModel): .... class Meta: abstract = True class MyUser(MyBaseModel,AuthUser): ... but any operation on the model gives me

How to extend Relationship class in neo4django

99封情书 提交于 2019-12-11 03:55:14
问题 I've seen that relationship properties are not yet implemented in neo4django. The workaround exposed in this thread is to have a new node type for each relationship with a property. I can't afford too much calculations so I don't want to use this technique. While reading the source code I've seen, as the docstring of the Relationship class, this : """Extend to add properties to relationships.""" My question is, how to do that ? Where to start to add at least one property ? Thanks 回答1: Despite

neo4django: AttributeError: type object 'Model' has no attribute '__metaclass__'

吃可爱长大的小学妹 提交于 2019-12-10 18:42:52
问题 I was just trying neo4django's very own example, namely from neo4django.db import models class Person(models.NodeModel): name = models.StringProperty() age = models.IntegerProperty() friends = models.Relationship('self',rel_type='friends_with') However, when running python manage.py syncdb I get the following error: AttributeError: type object 'Model' has no attribute '__metaclass__' Any ideas? (I would use label "neo4django" here in Stackoverflow, but it does not let me create a new label

Neo4django Relationship properties

霸气de小男生 提交于 2019-12-07 06:30:33
问题 So I've trying to model a small user-group relationship in Neo4j with Django. I am currently employing the Neo4django python package seen here. Now, I have nodes representing my users, and nodes representing my groups, and relationships that link them indicating membership. What I'm hoping to also do in the near future is add properties to this relationship such as date_joined. I looked around but there isn't too much documentation on how to achieve this. I'm sure there is a way of doing it,