This should do it.

db.table.
country.requires=IS_IN_DB(db,'country.id',format='%(name)s',orderby=db.country.name)


On Saturday, 15 June 2013 10:10:56 UTC-5, lesssugar wrote:
>
> I have a table 'country' storing country names. Its format is 
>
> format=lambda r: r.name
>
> I'm referencing the table in another one like this
>
> ...
> Field('country', db.country)
> ...
>
> When I create an update form for the second table, the Country field comes 
> as a drop-down and it's great. However, the country names are not sorted. 
> Is there a way to sort them on the level of defining tables or format?
>
>

-- 

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


Reply via email to