Massimo's way is even easier. Note, behind the scenes, this is still using the IS_IN_DB validator to generate the drop-down.
Anthony On Wednesday, February 1, 2012 3:35:38 PM UTC-5, Massimo Di Pierro wrote: > > Something like this? > > db.define_table('cities', > Field('name'), > Field('state'), > format = '%(name)s' > ) > > > form = SQLFORM.factory(Field('choose_city','reference cities')) > > On Feb 1, 2:25 pm, shartha <m.mirghorb...@gmail.com> wrote: > > So the problem is two folds. I have defined a simple table as in: > > > > db = DAL("sqlite://storage.sqlite") > > > > db.define_table('cities', > > Field('name'), > > Field('state'), > > ) > > > > Now I'd like to have a drop-down list in my view that reads from the > > name filed of the database cities. How can I achieve this? Any help > > would be highly appreciated. > > > > Thanks! > > S.