Ben
Ben

Reputation: 2472

Is there a ZODB hook for object changes post-commit?

How can I setup hooks that fire on ZODB object changes post-commit? I can setup handlers for IObjectWillBeMovedEvent and IObjectWillBeAddedEvent, but these fire immediately on object creation. Is there some other event or hook I can use that will only fire when the changes have been committed?

Upvotes: 1

Views: 210

Answers (1)

sdupton
sdupton

Reputation: 1879

The transaction package for Python does not use zope.event event notification, and has its own system for registering callable hooks. However, you must add the hook for each running transaction, which you might consider doing in an IObjectModifiedEvent (or similar) using zope.event.

See the description for ITransaction.addAfterCommitHook().

Upvotes: 2

Related Questions