📜  sqlalchemy orm 重复 - SQL 代码示例

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

代码示例1
product_obj = products.all()[0]

db.session.expunge(product_obj)  # expunge the object from session
make_transient(product_obj)  # http://docs.sqlalchemy.org/en/rel_1_1/orm/session_api.html#sqlalchemy.orm.session.make_transient

product_obj.product_uid = 'something'
db.session.add(product_obj)