Hi,

I'd like to implement an event to be fired when an InternalPrincipal shall be deleted from a PrincipalFolder.


class IObjectShallBeDeletedEvent(IObjectEvent):
        """Event, when an object will be deleted.
        """

class ObjectShallBeDeletedEvent(object):
        """Event, when an object will be deleted.
        """
        implements(IObjectDeletedEvent)

        def __init__(self, obj):
                self.object = obj

class MyPrincipal(InternalPrincipal):
        def __del__(self):
                notify(ObjectShallBeDeletedEvent(self))
                super(MyObject, self).__del__()

Because of some reason my event will not be fired. Did I miss something?

For now I implemented this by subclassing PrincipalFolder and adding my notify call to the __delitem__ method. That works well. But I would prefer an implementation like drafted above.

Regards,
Tobias
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to