[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/source.py widgets for required fields should only themselves be required if they

Fred L. Drake, Jr. fdrake at gmail.com
Mon Sep 25 14:16:05 EDT 2006


Log message for revision 70379:
  widgets for required fields should only themselves be required if they
  allow entering no value, so these select-based widgets are fine as-is
  

Changed:
  U   Zope3/trunk/src/zope/app/form/browser/source.py

-=-
Modified: Zope3/trunk/src/zope/app/form/browser/source.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/source.py	2006-09-25 16:41:48 UTC (rev 70378)
+++ Zope3/trunk/src/zope/app/form/browser/source.py	2006-09-25 18:16:03 UTC (rev 70379)
@@ -548,10 +548,13 @@
 
 class SourceSelectWidget(SelectWidget):
     """Provide a selection list for the item."""
-    
+
     def __init__(self, field, source, request):
         super(SourceSelectWidget, self).__init__(
             field, IterableSourceVocabulary(source, request), request)
+        # Even if the field is required, no input is needed, so don't
+        # worry the user about it:
+        self.required = False
 
 class SourceDropdownWidget(SourceSelectWidget):
     """Variation of the SourceSelectWidget that uses a drop-down list."""



More information about the Zope3-Checkins mailing list