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
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 to share