我想我找到了我的问题的答案。现在我在Google Datastore
中使用ndb.KeyProperty
来解决我的问题。
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
支持。
您的担忧是什么? – aschmid00
你想知道如何最好地模拟对象之间的关系吗? –