Hi I'm looking for a chance, to make some stuff on deleting an instance of a ZClass. On adding, there is no problem, cause of the constructor methods. but how will i make this on deleting? thanks and regards Joerg
=?iso-8859-1?Q?J=F6rg_Kubaile?= writes:
I'm looking for a chance, to make some stuff on deleting an instance of a ZClass. On adding, there is no problem, cause of the constructor methods. but how will i make this on deleting? You can try to define "manage_beforeDelete" as a Python Script.
Check, what parameters are passed. If you are lazy, use "*args" as parameter specification. Dieter
I'm looking for a chance, to make some stuff on deleting an instance of a ZClass. On adding, there is no problem, cause of the constructor methods. but how will i make this on deleting? You can try to define "manage_beforeDelete" as a Python Script.
Thanks Dieter. Thats it! But now the next question: which function will raise on Copy/Cut/Paste? On Cut/Paste, I need to write the new path to my Database. On Copy/Paste, I need to make a new entry. Any chance to do this? Cia Jorg
I'm looking for a chance, to make some stuff on deleting an instance of a ZClass. On adding, there is no problem, cause of the constructor methods. but how will i make this on deleting? You can try to define "manage_beforeDelete" as a Python Script.
Thanks Dieter. Thats it! But now the next question: which function will raise on Copy/Cut/Paste? On Cut/Paste, I need to write the new path to my Database. On Copy/Paste, I need to make a new entry. Any chance to do this?
ok, I got it by my own. I use manage_afterClone, to catch the Copy/Paste event. But now it's getting really complicated :) I have the function manage_beforeDelete, which deletes an entry in my database table. the id is a property of the object. Next, I have the function manage_afterClone, which makes an new entry to the database, and renames the id of the new object to a new object id with manage_renameObject. Now the Problem: it seams to be, that manage_renameObject causes the call of manage_beforeDelete! So my old object id will deleted in the database :( Any hints or suggestions? Thanks Jorg
=?us-ascii?Q?Jorg_Kubaile?= writes:
... Now the Problem: it seams to be, that manage_renameObject causes the call of manage_beforeDelete! That is correct. Zope renames by copying and deleting. This approach is needed, e.g., to get a catalog updated when objects are renames (all "URL" are changing).
Dieter
participants (2)
-
Dieter Maurer -
Jörg Kubaile