Hi Simon King, Thank's for your reply. autoflush disabling effectivly help me. About my functional problem, i finally use an other workflow including context manager usage.
Regards, Bastien. Le mardi 1 mars 2016 12:28:51 UTC+1, Simon King a écrit : > > > The answer to your first question is that SQLAlchemy has a feature called > "autoflush": > > http://docs.sqlalchemy.org/en/rel_1_0/orm/session_basics.html#flushing > > When you call session.query(), SQLAlchemy will first flush the session to > ensure that the results of the query match any changes that you've made in > the session. > > As for why you don't get a new revision when editing the description, try > inserting the following after the "description = 'rev2'" line: > > print content1 in session > print content1.revisions[0] in session > print content1.revisions[1] in session > > For me at least, it turns out that revisions[0] is not in the session. I > assume this is because of the "session.expunge(previous_revision)" call in > the VersionExtension. Since the object is no longer part of the session, > changes you make to the object will not be flushed to the database. > > Hope that helps, > > Simon > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
