[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Views/Browser - FormView.py:1.14

Marius Gedminas mgedmin@codeworks.lt
Wed, 9 Oct 2002 09:38:53 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv9997

Modified Files:
	FormView.py 
Log Message:
Context-wrap all fields (see Zope.App.OFS.Content.SQLScript.ISQLScript for an example why this is needed)

=== Zope3/lib/python/Zope/App/Forms/Views/Browser/FormView.py 1.13 => 1.14 ===
--- Zope3/lib/python/Zope/App/Forms/Views/Browser/FormView.py:1.13	Fri Oct  4 15:48:30 2002
+++ Zope3/lib/python/Zope/App/Forms/Views/Browser/FormView.py	Wed Oct  9 09:38:53 2002
@@ -19,7 +19,6 @@
      ValidationErrorsAll, ConversionErrorsAll
 from Zope.App.Forms.Exceptions import ConversionError
 from Zope.Schema import getFields, validateMappingAll
-#from Zope.Proxy.ContextWrapper import ContextWrapper
 from Zope.ComponentArchitecture import getView
 from Zope.Proxy.ProxyIntrospection import removeAllProxies
 from Zope.Publisher.Browser.BrowserView import BrowserView
@@ -45,10 +44,11 @@
         fields = getFields(self.schema)
         fields_order = self.fields_order
         if fields_order:
-            return [fields[name] for name in fields_order]
+            fields = [fields[name] for name in fields_order]
         else:
-            return fields.values()
-        
+            fields = fields.values()
+        return [ContextWrapper(field, self.context) for field in fields]
+
     def getField(self, name):
         'See Zope.App.Forms.Views.Browser.IForm.IReadForm'
         field = self.schema.getDescriptionFor(name)