Tom Dossis wrote:
mats.nordgren 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
  hooks.setSite(app.root())

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
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to