[Zope] Link between object

Thomas Guettler zopestoller@thomas-guettler.de
Thu, 31 Jan 2002 08:23:55 +0100


Dominique Jouniot wrote:

>Hello all,
>
>This is perhaps a newbie question (i am a newbie !!!).
>I am looking for a solution to link an object (an image or a file by exemple) 
>present in a zope folder to an other folder (like the ln command in unix). 
>The idea is to have the possibility to destroy the original object and all 
>the link in the same action.
>Is it possible with the ZODB ?
>
obj=MyObject()
folder1._setObject("id1", obj)
folder2._setObject("id2", obj)

This should work. At least in a python product. But you need to keep 
track of where you added your object.
The garbage collection whon't delete is as long there is one reference 
to obj.

An other way is to use mxmRelation.
I am developing a BTree based mxmRelation right now. Might need some 
more days to get
it out.

thomas