[web2py] Re: Ordering a dropdown in SQLFORM alphabetically

2015-12-18 Thread Massimo Di Pierro
should this be? db.mentors.auth_user_id.requires = IS_IN_DB(db, 'auth_user.id', '%(first_name)s', orderby = db.auth_user.first_name) On Wednesday, 16 December 2015 17:29:21 UTC-6, Evan Caldwell wrote: > > I tried: > db.mentors.auth_user_id.requires = IS_IN_DB(db, 'auth_user.id', '%(name)s' > , o

[web2py] Re: Ordering a dropdown in SQLFORM alphabetically

2015-12-16 Thread Evan Caldwell
I tried: db.mentors.auth_user_id.requires = IS_IN_DB(db, 'auth_user.id', '%(name)s', orderby = db.auth_user.first_name) but it had no effect. I read on another question about building and ordering a set and then using IS_IN_SET on that but I'm not sure how to go about doing that; can I do a quer

[web2py] Re: Ordering a dropdown in SQLFORM alphabetically

2015-12-16 Thread Niphlod
a proper IS_IN_DB with the correct orderby in models should be the easiest way to go. On Wednesday, December 16, 2015 at 8:33:06 PM UTC+1, Evan Caldwell wrote: > > > I am having a hard time ordering a dropdown in a SQLFORM alphabetically. > > In my model: > db.define_table('departments', > Fi