That's perfect - thanks a ton! Sent from my BlackBerry 10 smartphone on the Rogers network.
On Jan 11, 2014, at 2:20 PM, [email protected] wrote:
oh, well it depends on what kind of event you’re listening for - I was referring specifically to the “execute()” event which is a connection/engine level event. If you’re talking about an ORM level MapperEvent before_update/before_insert/before_delete, the “Engine” is not the target, the mapped class is. You'd need to check on the connection within the event: @event.listens_for(MyMappedClass, “before_insert”) def before_insert_db1(mapper, connection, target): if connection.engine is db1: # do the thing else: # don’t do the thing
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 http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out. | ||||
- [sqlalchemy] Multiple databases and event.listen? Ed Willis
- Re: [sqlalchemy] Multiple databases and event.listen? Michael Bayer
- Re: [sqlalchemy] Multiple databases and event.liste... ewillis
- Re: [sqlalchemy] Multiple databases and event.l... Michael Bayer
- Re: [sqlalchemy] Multiple databases and eve... ewillis
