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'),
> 'US': T('United States')
> }
>
> Which I am using to create a form, with the following entry:
>
> TR(T("Country:"), SELECT(*countries, _name="country",
> requires=IS_IN_SET(countries)))
>
> My problem is that the form is not showing the real names ('Germany',
> 'Spain', ...), but the codes ('DE', 'ES', ...). How can I make sure that
> the real names are shown, *but* the code is returned when selected?
>
> Thanks
> Daniel
>
--