0
q = Institution_Table.all().run(batch_size=2000).order('name')
應用排序順序給了我以下錯誤:爲什麼我的查詢失敗?試圖在GAE數據存儲實體
AttributeError: '_QueryIterator' object has no attribute 'order'
q = Institution_Table.all().run(batch_size=2000).order('name')
應用排序順序給了我以下錯誤:爲什麼我的查詢失敗?試圖在GAE數據存儲實體
AttributeError: '_QueryIterator' object has no attribute 'order'
在文檔中給出的例子表明,.order('name')
連接到查詢。
在您的示例中,您將在查詢運行後附加它。
嘗試:
q = Institution_Table.all().order('name')
results = q.run()
這裏:https://developers.google.com/appengine/docs/python/datastore/queries#Restrictions_on_Queries
或者,如果你想這一切在同一行: Q = Institution_Table.all()..順序( '名稱')運行(的batch_size = 2000) – dragonx 2013-02-18 16:55:28
真棒 - 感謝 - 它的工作 – user1769203 2013-02-18 17:23:25