在 Google App Engine NDB 中,有一种属性类型JsonProperty
,它采用 Pythonlist
或字典并自动对其进行序列化。
我的模型的结构取决于这个问题的答案,所以我想知道一个对象何时被反序列化?例如:
# a User model has a property "dictionary" which is of type JsonProperty
# will the following deserialize the dictionary?
object = User.get_by_id(someid)
# or will it not get deserialized until I actually access the dictionary?
val = object.dictionary['value']