gpt4 book ai didi

python - 更新应用引擎实体

转载 作者:太空狗 更新时间:2023-10-30 01:39:19 25 4
gpt4 key购买 nike

如何更新应用引擎中的现有记录。

最佳答案

只要实体定义了键,它就会在 put() 上更新:

record = Record(value='foo')
# This creates a new record
record.put()

record.value = 'shmoo'
# This updates it
record.put()

key = record.key()
record2 = Record.get(key)
record2.value = 'bar'
# Yet again this updates the same record
record2.put()

关于python - 更新应用引擎实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5066357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com