[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - editview.py:1.26 schemadisplay.py:1.5

Jim Fulton jim@zope.com
Thu, 5 Jun 2003 16:13:38 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv24717/src/zope/app/browser/form

Modified Files:
	editview.py schemadisplay.py 
Log Message:
Changed the way widgets are created and stored in forms.
Widgets (views on fields) were stored in attributes with the same
names as the fields. This led to conflicts with other view attribute
names in some cases. Now widgets are stored in attributes with names
equal to the field name with an added suffix of '_widget'. For
example, the widget for a title field is named "title_widget".


=== Zope3/src/zope/app/browser/form/editview.py 1.25 => 1.26 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.25	Sun Jun  1 11:59:27 2003
+++ Zope3/src/zope/app/browser/form/editview.py	Thu Jun  5 16:13:07 2003
@@ -76,7 +76,7 @@
             widget.setPrefix(prefix)
 
     def widgets(self):
-        return [getattr(self, name)
+        return [getattr(self, name+'_widget')
                 for name in self.fieldNames]
 
     def apply_update(self, data):


=== Zope3/src/zope/app/browser/form/schemadisplay.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/schemadisplay.py:1.4	Sun Jun  1 11:59:27 2003
+++ Zope3/src/zope/app/browser/form/schemadisplay.py	Thu Jun  5 16:13:07 2003
@@ -69,7 +69,7 @@
             widget.setPrefix(prefix)
 
     def widgets(self):
-        return [getattr(self, name)
+        return [getattr(self, name+'_widget')
                 for name in self.fieldNames]