[Zope3-dev] Re: How to Subscribe to Events?

Christian Heimes heimes@faho.rwth-aachen.de
Thu, 08 May 2003 17:11:24 +0200


Steve Alexander wrote:
> Marcus J. Ertl wrote:
>> And where would be the right place to register it? In the objects
>> __init__()?
> 
> 
> No. It will not have access to any context at that point, so it won't be 
> able to get at the event subscription service.

It's even not possible to call a function with is ContextWrapped or 
inherit from ContextAware. You have to use the afterAddHook method, see 
zope.app.interfaces.container.IAddNotifiable.

Christian