[Zope3-dev] zope.app.uniqueid question

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Aug 31 12:21:04 EDT 2004


On Tuesday 31 August 2004 12:15, Martijn Faassen wrote:
> What I'd like is a unique id facility which can track an object with a
> unique id even if it moves to a different container or gets renamed. So,
> it is always possible to retrieve an object even after people cut and
> paste it elsewhere. Is zope.app.uniqueid guaranteed to do this? At first
> I thought it isn't, but now I'm not sure anymore what it does. It only
> tracks ObjectAdded events, which are only sent if a new object is added
> (or at least an object with no parent).

As you mentioned below, the object reference is stored in the utility; 
therefore it will survive moves and renaming.

> Anyway, my hidden goal is to backport this to Zope 2 as part of Five,
> but that seems tricky, as the uniqueid utility stores objects directly
> which it then returns, while in Zope 2 these objects would need to be
> returned in their proper acquisition context, lacking __parent__ links
> and the like..

Yes, this seems kind of hard. Maybe you want to write an alternative 
implementation that stores the path, but listens to all the object events to 
correct the path, if the object is being moved, renamed, copied or whatever.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-dev mailing list