Hooking entity creation in SQLAlchemy

Posted by Dan Ellis on Stack Overflow See other posts from Stack Overflow or by Dan Ellis
Published on 2010-05-24T07:27:11Z Indexed on 2010/05/24 7:31 UTC
Read the original article Hit count: 223

Filed under:

I want to write a SessionExtension that fires a 'Foo-created' event or 'Bar-created' event every time a new Foo or new Bar is committed to the database. However, once inside the after_commit method, I don't know where to find which entities have been committed. Where do I get this information?

© Stack Overflow or respective owner

Related posts about sqlalchemy