What am I misunderstanding... ??

Building a form with fields that really need to be autocompleted 
(potentially 1,000+ possible values). 

Looked at the book which says "two possible uses for the autocomplete widget: 
to autocomplete a field that takes a value from a *list* or to autocomplete 
a *reference field*"
I assumed that "list" meant an ordinary Python list object, but when I try:

  fields = []
  ...

 name_list = ['name1', 'name2']
  fields.append(Field('school', 'string' , label=T('School Name?')
                                         , 
widget=SQLFORM.widgets.autocomplete(request , name_list, limitby=(0,10), 
min_length=0)
                                         , requires=IS_NOT_EMPTY()))
   ...

  enter_data_form=SQLFORM.factory(*fields, table_name='enter_data')

I get the following:
        <type 'exceptions.AttributeError'> 'list' object has no attribute 
'tablename'

which I interpret to mean that 'list' in this case means something 
different than I expected.

What am I doing wrong?

Thanks


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to