【发布时间】:2014-10-24 06:39:32
【问题描述】:
如何将地理点作为结构化属性重复?
我的代码如下所示:
class MyModel(EndpointsModel):
segments = ndb.StructuredProperty(ndb.GeoPt, repeated=True)
当我尝试运行代码并创建 MyModel 实例时,我收到以下错误:
AttributeError: type object 'GeoPt' has no attribute '_has_repeated'
How to find out if a model class is db or a ndb 似乎暗示 _has_repeated 是 ndb 模型特有的属性,https://cloud.google.com/appengine/docs/python/ndb/properties#structured 似乎表明 ndb.GeoPt 与 db.GeoPt 相同。
【问题讨论】:
标签: python google-app-engine google-cloud-datastore app-engine-ndb