the after_commit() event is independent of any flush, so the last event where the history API still reports the changed attributes on individual instances is after_flush(). If you need the aggregate of all attributes that were changed over many flushes within the span of a transaction, you'd probably want to use after_flush() and aggregate them all together somewhere.
checking attribute history in 0.7 is via attributes.get_history(): http://docs.sqlalchemy.org/en/rel_0_7/orm/session.html?highlight=get_history#sqlalchemy.orm.attributes.get_history On Jan 6, 2013, at 5:52 PM, Felix Schwarz wrote: > Hi, > > my question is how/if I can detect which attributes were changed when I get > the 'after_commit' event. (I think it isn't possible based on what I read in > the docs but I'd like to be sure.) If not, which other event could I use? > > What I want to achieve: I want to update an external search index > incrementally after a commit. Ideally I can check if one of the attributes > changed which are relevant for searching. > > fs > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
