Previously I could do:

search_options = {'string':['contains']}

fields = [db.wbmaster.parent_organisation, db.wbmaster.name_of_initiative]
links = [lambda row: A('View' , _href = URL('wbank', 'viewmaster', args = [
row.id]))]            form = SQLFORM.grid(db.wbmaster, deletable = False,
                                orderby = db.wbmaster.acrononym,
                                maxtextlength = 60,
                                fields = fields,
                                details = False,
                                links = links,
                                selectable = lambda ids: page_full_records(
ids),
                                searchable = True,
                                search_widget = lambda fields: SQLFORM.
search_menu(fields, search_options),
                                ui = 'jquery-ui' 

But this is no longer working.  I get

 File "/home/js/web2py/applications/nakb/controllers/wbank.py" 
<http://localhost:8000/admin/default/edit/nakb/controllers/wbank.py>, line 131, 
in master
    ui = 'jquery-ui'
  File "/home/js/web2py/gluon/sqlhtml.py", line 1724, in grid
    form = search_widget and search_widget(sfields,url()) or ''
TypeError: <lambda>() takes exactly 1 argument (2 given)




It would be great if we could add 'search_options' and 'search_fields'  
directly to the grid/smartgid options.

Otherwise how can I limit search options to make the usage of the 'Query' 
button a bit simpler for users?

Regards
Johann

Reply via email to