web/formfields.py
changeset 6333 e3994fcc21c3
parent 6225 a176e68b7d0d
parent 6285 b8a2c9b9a2cb
child 6582 8eb7883b4223
--- a/web/formfields.py	Tue Sep 21 16:35:37 2010 +0200
+++ b/web/formfields.py	Thu Sep 23 23:28:58 2010 +0200
@@ -877,6 +877,15 @@
         # XXX empty string for 'no' in that case for bw compat
         return [(form._cw._('yes'), '1'), (form._cw._('no'), '')]
 
+    def format_single_value(self, req, value):
+        """return value suitable for display"""
+        if self.allow_none:
+            if value is None:
+                return u''
+            if value is False:
+                return '0'
+        return super(BooleanField, self).format_single_value(req, value)
+
     def _ensure_correctly_typed(self, form, value):
         if self.allow_none:
             if value: