我想我找到了我的问题的答案。现在我正在使用ndb.KeyProperty
inGoogle Datastore
来解决我的问题。
class Trip(ndb.Model):
name = ndb.StringProperty()
details = ndb.TextProperty()
turl = ndb.StringProperty()
links = ndb.StringProperty(repeated = True)
tags = ndb.StringProperty(repeated = True)
destinations = ndb.KeyProperty(Destination1, repeated = True)
class Destination1(ndb.Model):
name = ndb.StringProperty()
location = ndb.StringProperty()
durl = ndb.StringProperty()
description = ndb.StringProperty()
deatils = ndb.StringProperty()
tags = ndb.StringProperty(repeated = True)
links = ndb.StringProperty(repeated = True)
我之前使用repeated=True
的不支持嵌套的概念。StructredProperty