我正在尝试用查询我的员工模型 .cypher 在我的Django视图中。我在其他地方使用过这个查询,所以我知道这个部分有效。
.cypher
query_string = "MATCH (n)-[r:REPORTS_TO|BRANCH_OF|OVERSEEN_BY]->() RETURN n, r" query_results = Employee.cypher( self = Employee, query = query_string, params = None) *** ERROR _pre_action_check() missing 1 required positional argument: 'action'
此错误指向以下第204行: https://github.com/neo4j-contrib/neomodel/blob/master/neomodel/core.py
此错误指向以下第204行:
https://github.com/neo4j-contrib/neomodel/blob/master/neomodel/core.py
我试过了:
另外,如果我试图通过在模型中定义密码调用,然后在视图中调用它来遵循文档……我还是有同样的错误
https://neomodel.readthedocs.io/en/latest/cypher.html
更新: 这里有完整的痕迹 https://imgur.com/a/o3rQr
def cypher(self, query, params=None):
self Employee.
self
Employee.
query query_string
query
query_string
params=None
Employee.cypher(query_string)
employee = Employee()
employee.cypher(query_string)