fixed problem with labels being helpers

This commit is contained in:
Massimo Di Pierro
2011-12-17 10:11:05 -06:00
parent a01cc89ff2
commit 36304ceaf3
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.4 (2011-12-16 11:57:23) stable
Version 1.99.4 (2011-12-17 10:10:41) stable
+4 -3
View File
@@ -1319,13 +1319,14 @@ class SQLFORM(FORM):
search_options['string'] = ['=','!=','<','>','<=','>=']
search_options['text'] = ['=','!=','<','>','<=','>=']
criteria = []
selectfields = {'':''}
selectfields = []
for field in fields:
name = str(field).replace('.','-')
criterion = []
options = search_options.get(field.type,None)
if options:
selectfields[T(field.label)] = str(field)
label = isinstance(field.label,str) and T(field.label) or field.label
selectfields.append((str(field),label))
operators = SELECT(*[T(option) for option in options])
if field.type=='boolean':
value_input = SELECT(
@@ -1346,7 +1347,7 @@ class SQLFORM(FORM):
criteria.insert(0,SELECT(
_id="w2p_query_fields",
_onchange="jQuery('.w2p_query_row').hide();jQuery('#w2p_field_'+jQuery(this).val().replace('.','-')).show();",
*[OPTION(label, _value=selectfields[label]) for label in selectfields]))
*[OPTION(label, _value=fname) for fname,label in selectfields]))
fadd = SCRIPT("""
jQuery('#w2p_query_panel input,#w2p_query_panel select').css(
'width','auto').css('float','left');