In fact that is the the problem. I want to fill the country widget with
just a list (ordinary python list of strings) of countries so the user can
select from that list.

So essentially the backing list of the auto complete isn't part of the db
but just a bunch of strings in an ordinary list
On 18 Jan 2016 01:12, "Massimo Di Pierro" <[email protected]>
wrote:

> I do not see a db.company.country, although I am not sure that is the
> problem.
>
> On Sunday, 17 January 2016 15:14:12 UTC-6, Seraaj Muneer wrote:
>>
>> db.define_table('company',
>>  Field('name', 'string', length=20, represent=lambda name, row: name.
>> capitalize(), required=True,
>>  unique=True, notnull=True,
>>  requires=[IS_NOT_EMPTY(error_message='You must enter a company name'),
>>  IS_MATCH('^[a-zA-Z0-9][a-zA-Z0-9 ,-.]*$')
>>  ]),
>>  Field('user_id', 'reference auth_user', ondelete='NO ACTION', label=
>> 'User',
>>  writable=False, readable=False,
>>
>>  ),
>>  Field('is_default', 'boolean', writable=False),
>>  address,
>>
>>  format=lambda r: r.name or 'No name company')
>> db.company.name.requires = IS_NOT_IN_DB(db, db.company.name,
>> error_message='This company name is in use')
>> db.company.country.widget=SQLFORM.widgets.autocomplete(request, COUNTRIES
>> , limitby=(0,10), min_length=2)
>>
>> I get
>>>
>>> <type 'exceptions.AttributeError'> 'tuple' object has no attribute
>>> 'tablename'
>>
>>
>> COUNTRIES is just a list of strings
>>
>> Thanks
>>
>>>
>>
>> On Wednesday, 30 April 2014 09:22:38 UTC, Johann Spies wrote:
>>>
>>> On 28 April 2014 21:38, Miguel AndrĂ©s Moya Rojas <[email protected]>
>>> wrote:
>>>
>>> Hello! My issue is this: I want to use the autocomplete widget (
>>>> SQLFORM.widgets.autocomplete) but my field is a list:string, and now
>>>> it shows all data in only one field, resulting in an awkward input. How can
>>>> I use this widget with a list:string field? Thanks in advance. :)
>>>>
>>>>
>>> And your code is ...?
>>>
>>> Regards
>>> Johann
>>>
>>> --
>>> Because experiencing your loyal love is better than life itself,
>>> my lips will praise you.  (Psalm 63:3)
>>>
>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/6a4KRtDE26M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to