Merge pull request #1951 from yamandu/issue/1950
correction to generate options also for fields generated with…
This commit is contained in:
+7
-6
@@ -2146,12 +2146,6 @@ class SQLFORM(FORM):
|
|||||||
value_input = widget_.widget(field, field.default, _id=_id,
|
value_input = widget_.widget(field, field.default, _id=_id,
|
||||||
_class=widget_._class + ' form-control',
|
_class=widget_._class + ' form-control',
|
||||||
**iso_format)
|
**iso_format)
|
||||||
elif hasattr(field.requires, 'options'):
|
|
||||||
value_input = SELECT(
|
|
||||||
*[OPTION(v, _value=k)
|
|
||||||
for k, v in field.requires.options()],
|
|
||||||
_class='form-control',
|
|
||||||
**dict(_id=_id))
|
|
||||||
elif (field_type.startswith('integer') or
|
elif (field_type.startswith('integer') or
|
||||||
field_type.startswith('reference ') or
|
field_type.startswith('reference ') or
|
||||||
field_type.startswith('list:integer') or
|
field_type.startswith('list:integer') or
|
||||||
@@ -2165,6 +2159,13 @@ class SQLFORM(FORM):
|
|||||||
_type='text', _id=_id,
|
_type='text', _id=_id,
|
||||||
_class="%s %s" % ((field_type or ''), 'form-control'))
|
_class="%s %s" % ((field_type or ''), 'form-control'))
|
||||||
|
|
||||||
|
if hasattr(field.requires, 'options'):
|
||||||
|
value_input = SELECT(
|
||||||
|
*[OPTION(v, _value=k)
|
||||||
|
for k, v in field.requires.options()],
|
||||||
|
_class='form-control',
|
||||||
|
**dict(_id=_id))
|
||||||
|
|
||||||
new_button = INPUT(
|
new_button = INPUT(
|
||||||
_type="button", _value=T('New Search'), _class="btn btn-default", _title=T('Start building a new search'),
|
_type="button", _value=T('New Search'), _class="btn btn-default", _title=T('Start building a new search'),
|
||||||
_onclick="%s_build_query('new','%s')" % (prefix, field))
|
_onclick="%s_build_query('new','%s')" % (prefix, field))
|
||||||
|
|||||||
Reference in New Issue
Block a user