fixed 1821:RadioWidget and CheckboxesWidget wrong behavior, thanks Paolo Caruccio

This commit is contained in:
mdipierro
2013-12-17 16:50:42 -06:00
parent 38de99fc9c
commit 28b9d322a2
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.8.2-stable+timestamp.2013.12.17.16.41.58
Version 2.8.2-stable+timestamp.2013.12.17.16.49.17
+5 -2
View File
@@ -45,6 +45,9 @@ except ImportError:
table_field = re.compile('[\w_]+\.[\w_]+')
widget_class = re.compile('^\w*')
def add_class(a,b):
return a+' '+b if a else b
def represent(field, value, record):
f = field.represent
if not callable(f):
@@ -334,7 +337,7 @@ class RadioWidget(OptionsWidget):
attr = cls._attributes(field, {}, **attributes)
attr['_class'] = attr.get('_class', 'web2py_radiowidget')
attr['_class'] = add_class(attr.get('_class'), 'web2py_radiowidget')
requires = field.requires
if not isinstance(requires, (list, tuple)):
@@ -398,7 +401,7 @@ class CheckboxesWidget(OptionsWidget):
values = [str(value)]
attr = cls._attributes(field, {}, **attributes)
attr['_class'] = attr.get('_class', 'web2py_checkboxeswidget')
attr['_class'] = add_class(attr.get('_class'), 'web2py_checkboxeswidget')
label = attr.get('label',True)