[Zope] manage_beforeDelete

Michel Pelletier michel@digicool.com
Mon, 24 Apr 2000 14:12:19 -0700


John Sutherland wrote:
> 
> In an effort to know when an instance deleted of my class, and not just when
> the reference count equal's zero, I did some digging in the Zope code, and
> found that if I create a function called manage_beforeDelete, this does
> exactly what I need.. It gets called before before the object gets deleted
> from Zope..
> 
> Now question is, is this safe to do,

Yes.

> overriding this function? I wouldn't
> want to corrupt ZODB or whatever... Anyone have an opinion on this?

This hook is meant to be overridden in just this way.  Keep in mind
though, don't override the hook on an object that defines its own
manage_beforeDelete without understanding the consequences.  If it's
your own type of object, then go for it.

-Michel