[Zope] Persistent references to persistent objects ?!?!

Paul Winkler pw_lists at slinkp.com
Fri Feb 6 17:17:00 EST 2004


On Fri, Feb 06, 2004 at 04:55:26PM -0500, Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote:
> Dieter,
> 
> Hmmm interesting point.  I suppose a basic rule of thumb would be that the
> reference should never be stored directly as an attribute of a folderish
> type ?
> 
> I can imagine many useful scenarios where keeping references to objects can
> be very handy (Versioning, workflow, lists of objects, etc ...) ... Although
> I have to admit the symlink think had never really even occured to me.  I'd
> imagine instead maintaining a list of references for instance, maybe stored
> as an attribute of some other non-folderish type ... you know maybe build
> some content-type class that, as part of it's functionality, keeps
> references to objects ?

mxmRelationsManager might help with this. I'm using it for
a similar purpose - maintaining paths of related objects
that are preserved even if the objects move.
It requires adding a line of code to your class's manage_beforeDelete 
and manage_afterAdd so that the paths get updated properly.

i haven't yet checked what happens if i restore a deleted
object using "Undo".  
/me goes to add that to his functional tests

-- 

Paul Winkler
http://www.slinkp.com




More information about the Zope mailing list