[Zope3-checkins] SVN: zope.formlib/trunk/ Moved default values for the `BooleanDisplayWidget` to the class definition.

Sebastian Wehrmann cvs-admin at zope.org
Fri Feb 22 12:11:20 UTC 2013


Log message for revision 129638:
  Moved default values for the `BooleanDisplayWidget` to the class definition.
  
  

Changed:
  U   zope.formlib/trunk/CHANGES.txt
  U   zope.formlib/trunk/src/zope/formlib/boolwidgets.py

-=-
Modified: zope.formlib/trunk/CHANGES.txt
===================================================================
--- zope.formlib/trunk/CHANGES.txt	2013-02-22 09:37:53 UTC (rev 129637)
+++ zope.formlib/trunk/CHANGES.txt	2013-02-22 12:11:19 UTC (rev 129638)
@@ -5,7 +5,8 @@
 4.2.1 (unreleased)
 ==================
 
-- Nothing changed yet.
+- Moved default values for the `BooleanDisplayWidget` from module to class
+  definition to make them changeable in instance.
 
 
 4.2.0 (2012-11-27)

Modified: zope.formlib/trunk/src/zope/formlib/boolwidgets.py
===================================================================
--- zope.formlib/trunk/src/zope/formlib/boolwidgets.py	2013-02-22 09:37:53 UTC (rev 129637)
+++ zope.formlib/trunk/src/zope/formlib/boolwidgets.py	2013-02-22 12:11:19 UTC (rev 129638)
@@ -115,17 +115,17 @@
     return widget
 
 
-_msg_true = _("True")
-_msg_false = _("False")
-
 class BooleanDisplayWidget(DisplayWidget):
 
+    _msg_true = _("True")
+    _msg_false = _("False")
+
     def __call__(self):
         if self._renderedValueSet():
             value = self._data
         else:
             value = self.context.default
         if value:
-            return _msg_true
+            return self._msg_true
         else:
-            return _msg_false
+            return self._msg_false



More information about the Zope3-Checkins mailing list