fixed a bug in SQLFORM.grid where export would fail if a search filter applied to a non-visible column

This commit is contained in:
Tim Richardson
2014-01-29 18:55:32 +11:00
parent ce2d958f9a
commit faecb124cc

View File

@@ -2191,8 +2191,11 @@ class SQLFORM(FORM):
if export_type in exportManager and exportManager[export_type]:
if request.vars.keywords:
try:
#the query should be constructed using searchable fields
sfields = reduce(lambda a, b: a + b,
[[f for f in t if f.readable] for t in tables])
dbset = dbset(SQLFORM.build_query(
fields, request.vars.get('keywords', '')))
sfields, request.vars.get('keywords', '')))
rows = dbset.select(left=left, orderby=orderby,
cacheable=True, *expcolumns)
except Exception, e: