callback function when object is deleted
I'm writing a product where users can maintain information about electronic equipment. I've made a class called eg. "Equipment", and an instance is created for each piece of equipment the user has. The user can also make a maintainance log entry for each instance. These log entries are stored in an external databases. If the user deletes an equipment object through the ZMI, I'd like the object to set a "deleted" flag on each log entry beforehand. Similar, if the deletion is undone, the object should remove the "deleted" flag. I suspect that this should be done through some inherited method from the Zope superclasses that is called by the ZMI, but which? - Carsten
Carsten Gehling wrote:
If the user deletes an equipment object through the ZMI, I'd like the object to set a "deleted" flag on each log entry beforehand. Similar, if the deletion is undone, the object should remove the "deleted" flag.
The manage_beforeDelete() and manage_afterAdd() hooks migh be what you need. They are called by zope on any object being added or deleted respectively. Don't know what they do in regard to undo though! Beware that they are also called copy/paste operations. regards Max M
participants (2)
-
Carsten Gehling -
Max M