[Zope-dev] Detecting object deletions

Robert Leftwich robert@leftfieldcorp.com
Sat, 15 May 1999 13:20:02 +1000


How do I detect if an object is being deleted ?
I need to detect when an object is being deleted in order to perform some clean up.

The deal is (excuse the highly imaginative names) :

Foo inherits from Bar which inherits from Folder
Foo has a __del__ method which prints 'Foo is being deleted'
When an instance of Foo is deleted (via manage_delObjects) I would expect __del__ to be called at some point but nothing happens.

Am I overlooking something obvious ?

Thanks
Robert Leftwich
(running Zope 1.10.2 on win32 NT)

PS This is becoming quite urgent, so if you can help, please do so !