[Zope3-Users] fine grained subscriber
Lorenzo Gil Sanchez
lgs at sicem.biz
Wed Mar 28 07:39:00 EDT 2007
El mié, 28-03-2007 a las 12:50 +0200, FB escribió:
>
> You need a dispatcher - a quite common concept in zope3:
>
> [events.py, not tested]
> from zope.event import notify
>
> def removeIntId(event):
> notify(event.object,event)
>
I think the notify call should be like notify((event.object, event))
> def addIntId(event):
> notify(event.object,event)
>
>
>
> [configure.zcml, not tested]
> [...]
> <subscriber for="zope.app.intid.interfaces.IntIdAddedEvent"
> handler=".event.addIntId"
> />
> <subscriber for="zope.app.intid.interfaces.IntIdRemovedEvent"
> handler=".events.removeIntId"
> />
> [...]
>
Ok, the removeIntId function is called and it dispatch the event through
the notify call.
Then, my original subscriber, e.g.:
<subscriber for=".interfaces.IMyInterface
zope.app.intid.interfaces.IIntIdRemovedEvent"
handler=".events.myInterfaceIntIdRemovedSubscriber"
/>
is still not called. I have checked that in the removeIntId subscriber
the object in event.object provides IMyInterface, but this makes no
difference.
Anyway, thanks for this answer (and all the other answer you gave me
before) :-)
Regards,
Lorenzo
More information about the Zope3-users
mailing list