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 NotImplementedError("Bulk updates are not yet supported")


Thanks again!



On 7 July 2013 17:14, Michael Bayer <mike...@zzzcomputing.com> wrote:

> 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 present
> at all right now.
>
> that particular info you can get like this:
>
> @event.listens_for(Session, "after_bulk_update")
> def bulk_ud(sess, query, ctx, result):
>     print result.context.compiled.params
>
>
>
>
>
> On Jul 7, 2013, at 5:51 AM, David Szotten <davidszot...@gmail.com> wrote:
>
> 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 out how to access this info from the available
> variables (session, query, query_context, result)
>
> Thanks
> -d
>
> --
> 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 sqlalchemy+unsubscr...@googlegroups.com.
>
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sqlalchemy/SwOckp6-Vh8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to