开发者

use sqlalchemy entity isolately

i just want to use an entity modify it to show something,but don't want to change to th开发者_运维问答e db, but after i use it ,and in some other place do the session.commit()

it will add this entity to db,i don't want this happen, any one could help me?


You can expunge it from session before modifying object, then this changes won't be accounted on next commits unless you add the object back to session. Just call session.expunge(obj).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜