you can also do

db.table.person_id.requires=IS_IN_DB(db(filter),'person.id','%(name)
s')

where filter is a query.

On Aug 7, 5:30 pm, David Zejda <d...@atlas.cz> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello!
>
> Is it possible to restrict or filter choices listed in a select box
> generated by SQLFORM for a field referring to other table?
>
> E.g. I have a field person_id with reference to person.id. I wish to
> allow only persons, who meet some criteria according to other fields in
> the person table or based on certain joins, to be offered in the select box.
>
> Thank you!
>
> David.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iEYEARECAAYFAkp8qvoACgkQ3oCkkciamVFHkQCcC0TyPb9QMSjfrDl7ly+1NxOa
> ERoAn0s5kfjMDwAvf8KUXWG7vPSFzj03
> =8cOP
> -----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
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