我在弄清楚如何设置 Neomodel 工作时遇到了真正的问题。我已经在 models.py 中定义了我的类,我正在导入它们,但我得到的只是一个......
ClassAlreadyDefined:类 models.Album 带有标签专辑已经定义:{frozenset({'Album'}): <class 'models.Album'>}
错误。这是我的代码的样子,例如:
from neomodel import StructuredNode, StringProperty, DateTimeProperty, IntegerProperty, UniqueIdProperty, RelationshipTo, RelationshipFrom
class Album(StructuredNode):
uid = UniqueIdProperty()
band = StringProperty()
name = StringProperty()
url = StringProperty()
band_name = StringProperty()
year = IntegerProperty()
genres = RelationshipTo('Genre', 'TAGGED')
fans = RelationshipFrom('Fan', 'BOUGHTBY')