[Zope-dev] Linking to objects, or Keeping track of moving objects

Michael Bernstein mbernstein@profitscape.net
Mon, 18 Oct 1999 15:56:31 -0700


Itamar Shtull-Trauring wrote:

> I'm creating a Recipe object, which will contain numerous Ingredient
> objects.  Each Ingredient objects has to point or reference a Food object,
> which is stored elsewhere in the database.
>
> So, we can have different Ingredients pointing at the same Food object.
>
> The question is, how do I create a reference to the Food object?  If I just
> store the path to the Food object as a string (e.g. a property containing
> "/Foods/Oil/OliveOil"), if someone moves the Food object my reference will
> be wrong.  Likewise if someone renames the Food object.
>
> I could each Food object a unique ID, and have some sort of lookup object
> that gives the path of an object based on ID, but what happens when someone
> does a "Copy" & "Paste"?
>
> I could store Food objects in an SQL db, but I'd much rather use ZODB so I
> can use acquisition and to reduce overhead.
>
> Any idea on how to do this?

This came up back in July, here was my original post:
http://www.zope.org:12080/archives/Catalog/archives/1999-July/006332.html

Some code was posted that might help:
http://www.zope.org:12080/archives/Catalog/archives/1999-July/006340.html
And a clarification:
http://www.zope.org:12080/archives/Catalog/archives/1999-July/006356.html

Eventually, I submitted a feature request to the collector which was downgraded
to a wish:
http://www.zope.org:8080/Collector/380/view

HTH,

Michael Bernstein.