【发布时间】:2013-04-03 08:54:59
【问题描述】:
正在寻找一种有效的方法来检查 db.Model 的特定属性是否已更改与 putting 它之前存储在数据存储中的版本。显然,我想避免从数据库中获取新实例!是否可以?像这样的:
class MyClass(db.Model):
prop = db.StringProperty()
instance = MyClass()
instance.string_property = 'string'
instance.put()
instance2 = db.get(instance.key())
instance2.string_property = 'string2'
instance2.put() #would like to detect that string_property was altered!
【问题讨论】:
标签: python google-app-engine google-cloud-datastore