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:
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
One more doubt is, is there a way to filter on the full json
something like this:
in your example only:
print(Session.query(Student).filter(Student.data_test
=={'foo':'bar'}).first())
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post