[Zope3-checkins] CVS: Zope3/src/zope/app/utilities - schema.py:1.12

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:09:35 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/utilities
In directory cvs.zope.org:/tmp/cvs-serv29664/src/zope/app/utilities

Modified Files:
	schema.py 
Log Message:
Fixed bug that caused multiple levels of proxying when a proxy was
given to __setitem__.


=== Zope3/src/zope/app/utilities/schema.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/utilities/schema.py:1.11	Wed Nov 12 13:46:32 2003
+++ Zope3/src/zope/app/utilities/schema.py	Fri Nov 21 12:09:34 2003
@@ -17,6 +17,7 @@
 """
 from types import FunctionType
 
+from persistence import Persistent
 from persistence.dict import PersistentDict
 
 from zope.security.proxy import trustedRemoveSecurityProxy
@@ -132,7 +133,10 @@
                 attrs[name] = fromFunction(value, name, name=name)
             else:
                 raise InvalidInterface("Concrete attribute, %s" % name)
-        value = Struct(value)
+
+        if not isinstance(value, Persistent):
+            value = Struct(value)
+
         setitem(self, self._attrs.__setitem__, name, value)
 
     # Methods copied from zope.interface.interface.InterfaceClass,




More information about the Zope3-Checkins mailing list