Re: [sqlalchemy] Cancel update and delete before commit

2017-12-10 Thread Tolstov Sergey
Mike, very thanks for answer. I just use custom function and add to object session. I create some lists to save object and after rollback i add them On this func i just use session.dirty, session.new, session.delete for rollback i use def user_commit(): ... config.session.rollback()

Re: [sqlalchemy] Cancel update and delete before commit

2017-12-10 Thread Tolstov Sergey
Mike, very thanks for answer. I just use custom function and add to object session. I create some lists to save object and after rollback i add them On this func i just use session.dirty, session.new, session.delete for rollback i use config.session.rollback() def user_commit(): ...

Re: [sqlalchemy] Cancel update and delete before commit

2017-12-10 Thread Tolstov Sergey
> > Mike, very thanks for answer. I just use custom function and add to object > session def user_commit(): ... config.session.commit() config.session.user_commit=user_commit -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post exam

Re: [sqlalchemy] Cancel update and delete before commit

2017-12-08 Thread Mike Bayer
On Fri, Dec 8, 2017 at 3:29 AM, Tolstov Sergey wrote: > I need to switch off changing (not new) database rows and write all changes > to specific table on event "before_commit". > > But when i try to use config.session.rollback() SqlAlchemy show me > > AttributeError: 'NoneType' object has no att

[sqlalchemy] Cancel update and delete before commit

2017-12-08 Thread Tolstov Sergey
I need to *switch off changing* (not new) database rows and write all changes to specific table on event "*before_commit*". But when i try to use *config.session.rollback()* SqlAlchemy show me *AttributeError: 'NoneType' object has no attribute 'transaction'* I try config.session.expunge al