[Zope-CVS] CVS: Products/CompositePage - tool.py:1.4
Shane Hathaway
shane at zope.com
Mon Oct 13 17:55:24 EDT 2003
Update of /cvs-repository/Products/CompositePage
In directory cvs.zope.org:/tmp/cvs-serv24502
Modified Files:
tool.py
Log Message:
When moving references, move the persistent reference object, not the proxy.
Unfortunately, this implementation creates a loose dependency on
the References product. It would be nice to solve this a different way.
A reference is a symlink and a proxy is a decorator, BTW. :-)
=== Products/CompositePage/tool.py 1.3 => 1.4 ===
--- Products/CompositePage/tool.py:1.3 Wed Oct 8 10:51:12 2003
+++ Products/CompositePage/tool.py Mon Oct 13 17:55:24 2003
@@ -126,6 +126,16 @@
# Add the elements and reorder.
for element in elements:
+
+ # XXX Loose, ugly dependency on the Reference product.
+ d = getattr(element, "__dict__", None)
+ if d is not None:
+ e = d.get("_Proxy__reference")
+ if e is not None:
+ # Move a reference object instead of the proxy.
+ element = e
+
+ element = aq_base(element)
new_id = target._get_id(element.getId())
element._setId(new_id)
target._setObject(new_id, element)
More information about the Zope-CVS
mailing list