我正在填充一个数据库,我有这些模型:
class Album(StructuredNode):
name = StringProperty(unique_index=False, required=True)
artist = StringProperty(unique_index=False, required=True)
slug = StringProperty(unique_index=True, required=True)
但是由于某种原因,当我尝试填充我的数据库时,如果我有两张同名但艺术家和蛞蝓不同的专辑,我会收到此错误:
File "/Users/datascientist/Desktop/populate.py", line 66, in <module>
album.save()
File "/Users/datascientist/anaconda/lib/python2.7/site-packages/neomodel/signals.py", line 25, in hooked
val = fn(self, *args, **kwargs)
File "/Users/datascientist/anaconda/lib/python2.7/site-packages/neomodel/core.py", line 159, in save
self._id = self.create(self.__properties__)[0]._id
File "/Users/datascientist/anaconda/lib/python2.7/site-packages/neomodel/core.py", line 289, in create
results = db.cypher_query(query, params)
File "/Users/datascientist/anaconda/lib/python2.7/site-packages/neomodel/util.py", line 216, in cypher_query
raise UniqueProperty(e.message)
neomodel.exception.UniqueProperty
如何使名称参数不唯一?