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

Jim Fulton jim@zope.com
Thu, 12 Dec 2002 11:09:10 -0500


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

Modified Files:
      Tag: AdapterAndView-branch
	Widget.py 
Log Message:
Fixed a bug in _showData (used to get data to be displayed in an edit
widget). We failed to use field defaults when there was no initial
data pr request data.


=== Zope3/lib/python/Zope/App/Forms/Views/Browser/Widget.py 1.14.2.1 => 1.14.2.2 ===
--- Zope3/lib/python/Zope/App/Forms/Views/Browser/Widget.py:1.14.2.1	Thu Dec 12 10:16:50 2002
+++ Zope3/lib/python/Zope/App/Forms/Views/Browser/Widget.py	Thu Dec 12 11:09:09 2002
@@ -89,8 +89,12 @@
         return value
 
     def _showData(self):
-        if (self._data is None) and self.haveData():
-            data = self.getData(1)
+
+        if (self._data is None):
+            if self.haveData():
+                data = self.getData(1)
+            else:
+                data = self.context.default
         else:
             data = self._data