[Zope3-checkins] SVN: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ - Clarify the fact that IDAVWidget could return a whole DOM tree if it wanted

Martijn Pieters mj at zopatista.com
Thu Oct 14 08:46:50 EDT 2004


Log message for revision 28175:
  - Clarify the fact that IDAVWidget could return a whole DOM tree if it wanted
    to.
  - Make sure such a DOM tree is correctly imported.
  
  This should be tested, really..
  

Changed:
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py

-=-
Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py	2004-10-14 12:45:42 UTC (rev 28174)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py	2004-10-14 12:46:49 UTC (rev 28175)
@@ -209,7 +209,12 @@
     """A specialized widget used to convert to and from DAV properties."""
     
     def __call__():
-        """Render the widget."""
+        """Render the widget.
+
+        Optionally, this method could return a minidom DOM Node as the value;
+        this node will then be inersted into the resulting DAV XML response. 
+        Use a DocumentFragment if you want to include multiple nodes.
+        """
     
     def setRenderedValue(value):
         """Set the DAV value for the property

Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py	2004-10-14 12:45:42 UTC (rev 28174)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py	2004-10-14 12:46:49 UTC (rev 28175)
@@ -239,7 +239,8 @@
                     el.appendChild(resp.createTextNode(value))
                 else:
                     if zapi.isinstance(value, minidom.Node):
-                        el.appendChild(value)
+                        el.appendChild(
+                            el.ownerDocument.importNode(value, True))
                     else:
                         # Try to string-ify
                         value = str(getattr(self, p + '_widget'))



More information about the Zope3-Checkins mailing list