web/formfields.py
changeset 7231 18bcb98d129a
parent 7166 dde161937d3e
child 7460 2455cdbeadca
child 7572 a554010417ce
equal deleted inserted replaced
7229:a60522259c2c 7231:18bcb98d129a
   873 
   873 
   874     def vocabulary(self, form):
   874     def vocabulary(self, form):
   875         if self.choices:
   875         if self.choices:
   876             return super(BooleanField, self).vocabulary(form)
   876             return super(BooleanField, self).vocabulary(form)
   877         if self.allow_none:
   877         if self.allow_none:
   878             return [('', ''), (form._cw._('yes'), '1'), (form._cw._('no'), '0')]
   878             return [(form._cw._('indifferent'), ''),
       
   879                     (form._cw._('yes'), '1'),
       
   880                     (form._cw._('no'), '0')]
   879         # XXX empty string for 'no' in that case for bw compat
   881         # XXX empty string for 'no' in that case for bw compat
   880         return [(form._cw._('yes'), '1'), (form._cw._('no'), '')]
   882         return [(form._cw._('yes'), '1'), (form._cw._('no'), '')]
   881 
   883 
   882     def format_single_value(self, req, value):
   884     def format_single_value(self, req, value):
   883         """return value suitable for display"""
   885         """return value suitable for display"""