[Zope] Copying objects

Dieter Maurer dieter@handshake.de
Sat, 17 Nov 2001 22:15:28 +0100


Jesper Holmberg writes:
 > ....
 > This does not give any errors. BUT: if a Link is added directly to an
 > Itinerary, the change is reflected in the DOM, but this does not work if I
 > add a Link to a Step.
 > 
 > It thus seems to me that the Step actually has a copy of the node it
 > was given as parameter when it was created, and not the original node
 > itself. Since it's only the copy that is being manipulated by the adding
 > of nodes, the original DOM which rests in the Itinerary object is not
 > affected.
I can well imagine that you work around Zope's persistence machinery:

  I expect (though I am not sure), that Zope's persistence machinery
  only garantees to preserve sharing for "persistent" objects.
  
  When you share objects that do not inherit from "Persistent",
  I expect that the sharing may be broken and you end up with
  two independent copies.

Dieter