Im new to sqlalchemy, Im query object and expunge of session for prevent the session save change, after add the object with change at session but not flush or commit.
when the ends controller, the session save my object, i dont want that, I want the object is lost if I did not flush or commit
my code:
object = model.DBSession.query(model.Object).filter_by( field = value ).first()
model.DBSession.expunge(object)
object.field = gfhggghfg
object.field2 = hsjsjsjsjs
model.DBSession.add(object)
#finish controller turbogearsr the session save the change. I have autocommit and autoflush = False