Maybe you should replace Field('doc_nr',suggest_widget(db.akb_doccenter.doc_nr with Field('doc_nr', widget=suggest_widget(db.akb_doccenter.doc_nr as the traceback indicates.
Regards, Kenji On 9月22日, 午後7:16, Johann Spies <johann.sp...@gmail.com> wrote: > As the standard Web2py autocomplete widget does not play nicely with > Internet Explorer, I am trying out the 'Suggest Widget' > (http://dev.s-cubism.com/plugin_suggest_widget) > > but I runs into a problem with this code: > > from plugin_suggest_widget import suggest_widget > > vorm = SQLFORM.factory( > Field('doc_nr', > suggest_widget(db.akb_doccenter.doc_nr, limitby=(0,20), > min_length=2))) > > This replaces: > vorm = SQLFORM.factory( > Field('doc_nr', widget = SQLFORM.widgets.autocomplete( > request, db.akb_doccenter.doc_nr, limitby = (0, 20), min_length = > 2))) > > But with the suggest-widget-code I get > > File "/home/js/web2py/applications/akb/controllers/doccenter.py" > <http://localhost:8000/admin/default/edit/akb/controllers/doccenter.py>, > line 134, in toetsdoknommer > Field('doc_nr',suggest_widget(db.akb_doccenter.doc_nr, > limitby=(0,20), min_length=1))) > File "/home/js/web2py/gluon/sqlhtml.py", line 1281, in factory > return SQLFORM(DAL(None).define_table(table_name, *fields), **attributes) > File "/home/js/web2py/gluon/sqlhtml.py", line 867, in __init__ > elif field.type.startswith('list:'): > AttributeError: 'suggest_widget' object has no attribute 'startswith' > > What am I missing? > > Johann > -- > May grace and peace be yours in abundance through the full knowledge of God > and of Jesus our Lord! His divine power has given us everything we need for > life and godliness through the full knowledge of the one who called us by > his own glory and excellence. > 2 Pet. 1:2b,3a