On Friday, August 7, 2015 at 12:18:12 PM UTC-4, Luis Valladares wrote:
>
> Thanks Anthony! using the option helper and returning without the 
> dictionary solved my issue, there is other errors on the javascript but i 
> already solved it, now works well, one more question: There is no built-in 
> function that creates a dropdown list from a DAL select?
>

No, but you can do:

SELECT([OPTION('', _value='')] +
       [OPTION(r.nombre, _value=r.id) for r in
        db(db.municipios.estado == request.args(0)).select()]) 

Wouldn't be hard to write a function to encapsulate that (pass in a DAL Set 
and the names of the fields to use in each OPTION).

Note, the first OPTION is just there in case you want an empty slot at the 
top of the dropdown.

Anthony

-- 
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