# HG changeset patch # User Florent <florent@secondweb.fr> # Date 1242745554 -7200 # Node ID e96f50e5209900988d983db6faddecdfacec0d74 # Parent b49fdd5ce8d2ca79aad352249b93a6584888b2c6 allow easy arbitrary separator between checkbox/ radio widgets diff -r b49fdd5ce8d2 -r e96f50e52099 web/formwidgets.py --- a/web/formwidgets.py Tue May 19 16:58:25 2009 +0200 +++ b/web/formwidgets.py Tue May 19 17:05:54 2009 +0200 @@ -200,6 +200,7 @@ def render(self, form, field): name, curvalues, attrs = self._render_attrs(form, field) domid = attrs.pop('id', None) + sep = attrs.get('separator', u'<br/>') options = [] for i, (label, value) in enumerate(field.vocabulary(form)): iattrs = attrs.copy() @@ -208,7 +209,7 @@ if value in curvalues: iattrs['checked'] = u'checked' tag = tags.input(name=name, type=self.type, value=value, **iattrs) - options.append(tag + label + '<br/>') + options.append(tag + label + sep) return '\n'.join(options)