Tom Dossis wrote:
The IntId subscribers are fired on
zope.app.container.interfaces.IObjectAddedEvent and IObjectRemovedEvent.
That's correct, however the (IWrite)Container __setitem__ method invokes
the ObjectAddedEvent for you when you add an object to the container.
Your code below looks like it's running zope directly, e.g. `zopectl
debug`. In this case you need to explicitly set a/the current site
yourself. Try insert the following first up...
from zope.app.component import hooks
Correct. SItes are usually found during traversal. When doing stuff
before any traversal is happening, you won't have a local site yet. So,
using setSite() is appropriate, just remember to call setSite(None)
afterwards for cleanup!
Zope3-users mailing list