Hi David,

use any query in combination with widget e.g.:

q=db.person.name.like('A%')
r=db(q).select(db.person.id,db.person.name)
db.table2.person_id.widget= lambda self,value: SELECT
(_name='person_id',*[OPTION(e.name,_value=e.id) for e in r])

you can also build the validator:
db.table2.person_id.requires=IS_IN_SET([e.id for e in r])

Notes:
- you have to handle the special case where r is empty.
- _name in SELECT is required, otherwise appadmin does not work
  (@developers: should appadmin.insert check form.errors ?)


Denes.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to