From 5b7167436b6f5178712f212c9cd9198ce7a238fc Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 4 Dec 2013 10:43:50 -0600 Subject: [PATCH] optional label in checkbox widget, fixed issue 1797, thanks Richard --- VERSION | 2 +- gluon/sqlhtml.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c4e73ede..048f136d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.8.2-stable+timestamp.2013.12.03.09.31.36 +Version 2.8.2-stable+timestamp.2013.12.04.10.42.46 diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index ef3b26f8..0be5b768 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -400,6 +400,8 @@ class CheckboxesWidget(OptionsWidget): attr = cls._attributes(field, {}, **attributes) attr['_class'] = attr.get('_class', 'web2py_checkboxeswidget') + label = attr.get('label',True) + requires = field.requires if not isinstance(requires, (list, tuple)): requires = [requires] @@ -439,7 +441,8 @@ class CheckboxesWidget(OptionsWidget): requires=attr.get('requires', None), hideerror=True, _value=k, value=r_value), - LABEL(v, _for='%s%s' % (field.name, k)))) + LABEL(v, _for='%s%s' % (field.name, k)) + if label else '')) opts.append(child(tds)) if opts: