📜  烧瓶 sqlalchemy.提交不保存更改 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:07.479000             🧑  作者: Mango

代码示例1
#When updating a JSON(B) attribute I 
#think you might need to flag it as modified
from sqlalchemy.orm.attributes import flag_modified

custObj.contextjason = { 'foo':'bar', 'so':'be it'}
flag_modified(custObj, "contextjason")
db.session.commit()