获取 - 无法在节点集上安装遍历"has",匹配节点时出错



我使用Django与Neomodel和Django_Neomodel连接到AuraDB并获取数据。在我看来,我正在做:

def homePage(request):
name = request.user.last_name + ', ' + request.user.first_name
my_person_node = Person.nodes.get(person_name=name)
...

我的个人模型:

class Person(DjangoNode):
id = UniqueIdProperty(primary_key=True)
person_id = StringProperty(unique_index=True)
person_name = StringProperty(unique_index=False) 
service_position = StringProperty(unique_index=False)
has = Relationship('Research_Topic', 'has', model=Person_has_Research_Topic)
is_teaching = RelationshipTo('Course', 'is_teaching')

class Meta:
app_label = 'profiles'
def __str__(self):
return self.person_name

和"有"关系模型:

class Person_has_Research_Topic(StructuredRel):
type = StringProperty()

这引发了一个错误:ValueError:无法安装遍历"has"在NodeSet 上存在

也许您应该更改class属性"has"。我在使用"source"作为属性名称时遇到了这个问题,并通过更改新名称解决了这个问题。

最新更新