I would make a lookup table instead of using IS_IN_SET(), than use IS_IN_DB(db, 'countries.country_code', db.countries.country_name)...
db.define_table('countries', Field('country_code',...), Field('country_name',...)) Richard On Wed, Aug 29, 2012 at 3:15 AM, Daniel Gonzalez <gonva...@gmail.com> 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 > > -- > > > > --