[Zope3-Users] fine grained subscriber
Lorenzo Gil Sanchez
lgs at sicem.biz
Wed Mar 28 07:56:35 EDT 2007
El mié, 28-03-2007 a las 13:39 +0200, Lorenzo Gil Sanchez escribió:
> 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 changed the removeIntId dispatcher to this code:
def removeIntId(event):
adapters = zope.component.subscribers((event.object, event), None)
for adapter in adapters:
pass # getting them does the work
and now it works!! My subscriber is called only when an IntId is removed
on objects that provide IMyInterface.
Thanks a lot Mark, for showing me the right direction.
Regards,
Lorenzo
More information about the Zope3-users
mailing list