[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.53

Gary Poster gary at zope.com
Fri Aug 15 18:55:49 EDT 2003


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

Modified Files:
	vocabularywidget.py 
Log Message:
Make vocabulary widgets fit better into the new world widget order--validation errors should be correctly (or better) displayed now



=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.52 => 1.53 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.52	Wed Aug 13 19:44:54 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py	Fri Aug 15 17:55:44 2003
@@ -189,7 +189,10 @@
     def __call__(self):
         if self._data is self._data_marker:
             if self.hasInput():
-                value = self.getInputValue()
+                try:
+                    value = self.getInputValue()
+                except WidgetInputError:
+                    return self.request.form.get(self.name, self._missing)
             else:
                 value = self._getDefault()
         else:
@@ -228,7 +231,9 @@
         try:
             field.validate(value)
         except ValidationError, v:
-            raise WidgetInputError(self.context.__name__, self.title, v)
+            self.error = WidgetInputError(
+                self.context.__name__, self.title, v)
+            raise self.error
 
         return value
 




More information about the Zope3-Checkins mailing list