Re: [sqlalchemy] after_bulk_update table/column info?

2014-07-24 Thread clarkie
Hi, I am trying to do something similar - I am using the versioning example from here - http://docs.sqlalchemy.org/en/rel_0_7/orm/examples.html?highlight=examples#versioned-objects But instead of using before_flush I want to use after_builk_insert. This is because we use update query in our

Re: [sqlalchemy] after_bulk_update table/column info?

2014-07-24 Thread clarkie
Hi, I am trying to do something similar - I am using the versioning example from here - http://docs.sqlalchemy.org/en/rel_0_7/orm/examples.html?highlight=examples#versioned-objects But instead of using before_flush I want to use after_bulk_update. This is because we use update query in our

Re: [sqlalchemy] after_bulk_update table/column info?

2014-07-24 Thread clarkie
Thanks for your quick response. Sorry, my question was not very clear. This is the version library I am using - https://github.com/zzzeek/sqlalchemy/blob/master/examples/versioned_history/history_meta.py In this I want to replace the before_flush with after_bulk_update - since both have session

Re: [sqlalchemy] after_bulk_update table/column info?

2014-07-24 Thread Michael Bayer
I think I got your question fully, and I know what example you're using. The example relies on SQL rows being represented by objects that are in memory in Python. When you use query().update(), this is not the case; a SQL string is emitted to the database and there doesn't need to be any

Re: [sqlalchemy] after_bulk_update table/column info?

2014-07-24 Thread clarkie
Great! yes, your comments made more sense after reading more of the extensive documentation. thanks again..I ended up doing the same with a slight variation - @event.listens_for(session, ‘after_bulk_update') def after_bulk_update(session, query, query_context, result): (still using 0.7)

[sqlalchemy] after_bulk_update table/column info?

2013-07-07 Thread David Szotten
Hi, Is it possible to find out which class/columns were included in the update from an `after_bulk_update` event handler? From what i can tell from the source, this information lives on the `BulkUpdate(Evaluate in my case)` object which isn't passed to the event handler, and I can't figure

Re: [sqlalchemy] after_bulk_update table/column info?

2013-07-07 Thread Michael Bayer
this should probably be available as some documented helper function for now, it's tricky to figure out up front what parameters these events will need. Really these bulk events should get to know all the arguments that were passed, including the synchronize_session argument which isn't

Re: [sqlalchemy] after_bulk_update table/column info?

2013-07-07 Thread David Szotten
Awesome, thanks! (For the record, i was ultimately looking for the field types involved in the update, which i found with your help above as: for bind in result.context.compiled.binds.values(): field_type = bind.type if isinstance(field_type, MyField): raise