From 36304ceaf355189a9b4e5000ec160edf88f5b6fb Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Sat, 17 Dec 2011 10:11:05 -0600 Subject: [PATCH] fixed problem with labels being helpers --- VERSION | 2 +- gluon/sqlhtml.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index e67dddc0..dc67e1ef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2011-12-16 11:57:23) stable +Version 1.99.4 (2011-12-17 10:10:41) stable diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index c7d91c97..c10e9f05 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -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');