简单问题 1. 如何检查事务中是否执行了部分代码?2、如果可能的话,如何获取交易信息?
def someCode():
class DeleteMe(db.Model):
pass
#how to check it here?
key = db.Key.from_path(DeleteMe.kind(), 'test')
model = DeleteMe.get(key)
if model is None:
model = DeleteMe(key = key)
model.put()
我想检查 someCode() 是否在事务中运行:
db.run_in_transaction(someCode)
或不:
someCode()