2013-03-19 105 views
4

我有一個使用neo4django映射器在neo4j(1.8.2版)上運行查詢的Django(1.4.0版)web應用程序。通過neo4django連接到neo4j時出錯

但是,只要我做一個查詢像

OnlinePerson.objects.filter(name="Bijan") 

我得到一個運行時錯誤的

('The type node for class OnlinePerson could not be created in the database.', StatusException()) 

我嘗試了很多不同的東西,但解決不了!

Traceback: 
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response 
    111.       response = callback(request, *callback_args, **callback_kwargs) 
File "/Users/Bijan/BHIC/mySVN/NeoD/src/NeoD/views.py" in home 
    22.  return render_to_response('index.html', {'Person' : entries, 'Person2': ["Bijan","Nastaran"]}) 
File "/Library/Python/2.7/site-packages/django/shortcuts/__init__.py" in render_to_response 
    20.  return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) 
File "/Library/Python/2.7/site-packages/django/template/loader.py" in render_to_string 
    171.   return t.render(Context(dictionary)) 
File "/Library/Python/2.7/site-packages/django/template/base.py" in render 
    140.    return self._render(context) 
File "/Library/Python/2.7/site-packages/django/template/base.py" in _render 
    134.   return self.nodelist.render(context) 
File "/Library/Python/2.7/site-packages/django/template/base.py" in render 
    823.     bit = self.render_node(node, context) 
File "/Library/Python/2.7/site-packages/django/template/debug.py" in render_node 
    74.    return node.render(context) 
File "/Library/Python/2.7/site-packages/django/template/defaulttags.py" in render 
    145.   len_values = len(values) 
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in __len__ 
    85.     self._result_cache = list(self.iterator()) 
File "/Library/Python/2.7/site-packages/neo4django/db/models/query.py" in iterator 
    733.   for model in self.query.execute(using): 
File "/Library/Python/2.7/site-packages/neo4django/db/models/query.py" in execute 
    610.    type_node = self.nodetype._type_node(using) 
File "/Library/Python/2.7/site-packages/neo4django/db/models/base.py" in _type_node 
    423.    return cls.__type_node_classmethod(using) 
File "/Library/Python/2.7/site-packages/neo4django/db/models/base.py" in __type_node 
    406.    raise RuntimeError(error_message, e) 

Exception Type: RuntimeError at/
Exception Value: ('The type node for class OnlinePerson could not be created in the database.', StatusException()) 
+1

你能用neo4django和Neo4j的版本更新這個問題嗎? – 2013-03-20 13:14:48

回答

2

最後,在經歷了很多困難並嘗試了不同的解決方案之後,問題才得以解決。我認爲主要問題是我的neo4j版本(1.8.2)。

切換回1.7.2後,一切正常。

+1

PyPi上的neo4django版本(0.1.7)支持1.7.2- neo4django,GitHub支持1.8.2-1.9M05。如果你想要最新版本,你總是可以'安裝pip -e git + https:// github.com/scholrly/neo4django#egg = neo4django-dev'。祝你好運! – 2013-03-20 19:20:52

0

您是否安裝了Neo4j Gremlin插件?類型節點是使用Gremlin插件創建的,因爲它們需要某些事務性承諾。它通常默認安裝。不幸的是,一些環境(如Heroku)禁用了該插件。

+0

是的,Gremlin已經安裝好了。 – bijbij 2013-03-20 19:04:48