[Zope] need lesson in zope's OO architecture

friedrich steindl zope at floSoft.net
Mon Jul 26 16:24:59 EDT 2004


hi list,

i built a special object in zope, which holds most of its data outside of ZODB 
(in mySQL)

obviously i had to override the _delObject() method, that at deletion of the 
zope object my external data is deleted too

for better control of these special objects i built a special folder, which 
holds those objects

my problem -

when my special folder is subfolder of a normal folder, and this normal folder 
is renamed, the rename method of the above normal folder is triggered

but a rename does deletion of the children object and creates a new one

that means _my_  delObject() from special folder and special objects is 
executed and kills my external data )-:


v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v

def manage_renameObject(self, id, new_id, REQUEST=None):
        ...
        ...
        ob=self._getOb(id)
        ...
        ...     
        self._delObject(id)           ## this destroys my external data
        ob = aq_base(ob)
        ob._setId(new_id)
        ...
        ...

v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v


the problem seems for me that methods from parent container take actions on 
their children

and children can never distinguish between delete by renaming and real delete

a similar problem is cut / copy / paste where i cannot decide if copying my 
special object (for copy/paste) or doing nothing (for cut/paste)

i have no idea how to solve this (without rewriting core zope elements like 
CopySource, ObjectManager), because i cannot get control over the parent 
objects from my folder
 

do i heavily misunderstand something ???
can i solve this problem somehow ???


thank you for every input


fritz
(-:fs)




More information about the Zope mailing list