[Zope-dev] Unique and Contant object IDs
Chris Withers
chrisw@nipltd.com
Wed, 25 Oct 2000 12:59:25 +0100
Toby Dickenson wrote:
>
> > Yeah, I'd love an ID I could use to grab an object no matter how often
> > it was used.
>
> I suspect you will have to build this yourself. Store a sufficiently random
> id inside your objects when they are created, and use a ZCatalog to index
> them.
blech! ;-)
> > Why wouldn't the following work though:
> >
> > ...in a class method...
> >
> > self.theobject = theObject
> >
> > ...where theObject is something I want a reference to and self is a
> > persistent class...
>
> theObject would need to be persistent too. This has a number of
> characteristics that I would class as problems, but may be exactly what you
> want:
>
> * theObject will have different acquisuition context when accessed through
> its main path, and through self.theobject. This means different:
> * security
:-(
> * absolute_url
...that'd probably behaev how I'd want
> * configuration obtained through acquisition. What if theObject is
> CatalogAware?
CatalogAware is the work of the devil anyway ;-) ZPatterns ahs got to be
better for doing that kindof stuff ;-)
> * theObject isnt removed from the database when it is deleted from its
> folder; this other reference keeps it alive.
That, too, would be what I want... although I can think of other
situations where that would be bad... argh!
cheers,
Chris