flask py2neo --- ValueError:节点(:U {})不属于该图

时间:2019-01-05 19:12:08

标签: flask neo4j py2neo

我是py2neo和flask的新手,我已经从http://nicolewhite.github.io/neo4j-fl下载了带有Neo4j和Py2neo微博教程源代码的Flaskr Extended…到我的本地PC 并根据github上的问题发布了更改建议。我正在使用带有neo4j和flask的Windows anaconda环境。我可以运行http://localhost:5000/上的微博,但是尝试注册用户时出现以下错误。

builtins.ValueError
ValueError: Node (:U {}) does not belong to this graph 

Traceback (most recent call last):

  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\_compat.py", line 35, in reraise
    raise value
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\_compat.py", line 35, in reraise
    raise value
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\FlaskProject\neo4j-flask\blog\views.py", line 21, in register
    elif not User(username).register(password):
  File "C:\FlaskProject\neo4j-flask\blog\models.py", line 24, in register
    if not self.find():
  File "C:\FlaskProject\neo4j-flask\blog\models.py", line 20, in find
    user = graph.match('User', 'username', self.username).first()
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\py2neo\matching.py", line 273, in first
    return self.graph.evaluate(*self._query_and_parameters())
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\py2neo\matching.py", line 307, in _query_and_parameters
    verify_node(start_node)
  File "C:\Users\Teaka\AppData\Local\conda\conda\envs\myflask\lib\site-packages\py2neo\matching.py", line 284, in verify_node
    raise ValueError("Node %r does not belong to this graph" % n)
ValueError: Node (:U {}) does not belong to this graph

0 个答案:

没有答案