Currently autocomplete does not have a parameter to create a subset, but it 
would be a nice addition.


On Thursday, January 24, 2013 6:14:56 AM UTC-5, Dragan Matic wrote:
>
> I would like autocomplete to show just a subset of data, not all rows in 
> table. Is it possible to use query in autocomplete like this? 
>
>   
> query = db.recipe.user_id==auth.user_id
>     
> form=SQLFORM.factory(Field('title', 'string', required=True, requires=
> IS_NOT_EMPTY()),
>         Field('type', 'string', 
>              widget=SQLFORM.widgets.autocomplete(request, db(query).select
> (db.recipe.type), limitby=(0, 10), min_length=2)), 
>         Field('body', 'text'))
>
>
> This currently throws the following exception:
> <type 'exceptions.AttributeError'> 'Rows' object has no attribute 
> 'tablename'
>

-- 

--- 
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/groups/opt_out.


Reply via email to