1
財產
說我有一個ndb.Model
類,我想作爲一個StructuredProperty
使用另一個模型類:NDB排序由StructuredProperty
class CommonExtraData(ndb.Model):
count = ndb.IntegerProperty(required=True)
class MyObject(ndb.Model):
name = ndb.StringProperty(required=True)
extra = ndb.StructuredProperty(CommonExtraData, required=True)
我能那麼做這樣的查詢:
MyObject.query().order(-MyObject.extra.count)
我在文檔中找不到示例,並且由於我從舊API重構爲NDB,因此我的開發環境目前沒有正常工作。
大約重複性能的事是沒有什麼不同比它由訂貨時一個重複的非結構化財產。 – 2012-04-02 03:50:59