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
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
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
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
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)
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
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
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