web/formwidgets.py
changeset 7231 18bcb98d129a
parent 7115 1f1d8c35cc3e
child 7411 238da9684f99
equal deleted inserted replaced
7229:a60522259c2c 7231:18bcb98d129a
   476 
   476 
   477     You can specify separator using the `separator` constructor argument, by
   477     You can specify separator using the `separator` constructor argument, by
   478     default <br/> is used.
   478     default <br/> is used.
   479     """
   479     """
   480     type = 'checkbox'
   480     type = 'checkbox'
       
   481     default_separator = u'<br/>\n'
   481     vocabulary_widget = True
   482     vocabulary_widget = True
   482 
   483 
   483     def __init__(self, attrs=None, separator=u'<br/>\n', **kwargs):
   484     def __init__(self, attrs=None, separator=None, **kwargs):
   484         super(CheckBox, self).__init__(attrs, **kwargs)
   485         super(CheckBox, self).__init__(attrs, **kwargs)
   485         self.separator = separator
   486         self.separator = separator or self.default_separator
   486 
   487 
   487     def _render(self, form, field, renderer):
   488     def _render(self, form, field, renderer):
   488         curvalues, attrs = self.values_and_attributes(form, field)
   489         curvalues, attrs = self.values_and_attributes(form, field)
   489         domid = attrs.pop('id', None)
   490         domid = attrs.pop('id', None)
   490         # XXX turn this as initializer argument
   491         # XXX turn this as initializer argument