[web2py] Re: FORM with a SELECT and a mapping

2012-08-29 Thread Daniel Gonzalez
Thanks Anthony, it works! I have prepared this wrapper, useful for newbies like me: def form_prepare_opts(mydict): return [OPTION(mydict[code], _value=code) for code in mydict] And then, in the controller function: countries_opts = form_prepare_opts(countries) Which can be used to init

[web2py] Re: FORM with a SELECT and a mapping

2012-08-29 Thread Anthony
SELECT([OPTION(countries[code], _value=code) for code in countries]) Anthony On Wednesday, August 29, 2012 3:15:13 AM UTC-4, Daniel Gonzalez wrote: > > Hi, > > I have the following map: > > countries = { > 'DE': T('Germany'), > 'ES': T('Spain'), > 'IT': T('Italy'), >