AppEngine: are the items stored in a StringListProperty kept in the same order?

After looking through the docs on App Engine and StringListProperty

or ListProperty

I can't find if there is a guarantee for the order of the items in the list. That is, I would like to be sure that the order in the list remains the same despite putting in and out of the DataStore:

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']

      

Does AppEngine provide any guarantees regarding the order of items in a List or StringList?

+2


source to share


2 answers


Yes, for the documents ,

The order is preserved, so when objects are returned by queries and get (), the properties of the list will have values ​​in the same order as when they were saved.



This is the last sentence of the first paragraph in the URL I gave.

+3


source


I can't seem to find this explicitly in the documentation, but as per Google I / O talk about DataStore , StringListProperty will sort the same way you put it.



+2


source







All Articles