2009-10-22 23 views
2

在瀏覽App Engine和StringListPropertyListProperty的文檔後,我似乎無法找到列表中項目的順序是否有保證。也就是說,我想是肯定列表順序保持不變,儘管將與從數據存儲越來越:AppEngine:存儲在StringListProperty中的項目是否總是保持相同的順序?

instance = MyModel() 
instance.list_property = ['a', 'b', 'c'] 
instance.put() 

# Retrieve the model again 
instance2 = MyModel.get_by_id(instance.key().id()) 
assert instance2.list_property == ['a', 'b', 'c'] 

不AppEngine上做出有關在列表或StringList的項目的順序任何保證?

回答

3

是的,每the docs

順序被保存,所以當實體 由查詢返回和get(), 列表屬性將在 值相同的順序,當他們 存儲。

這是我給出的URL的第一段的最後一句。

相關問題