On Thursday, March 19, 2015 at 1:10:34 PM UTC-4, Moiz Nagpurwala wrote:
>
> Field('foo', 'reference auth_user', requires=IS_IN_DB(db, 'auth_user.id', 
>> '%(first_name)s %(last_name)s'))
>>
>
> This worked for me.
>

It works, but (a) it only affects select dropdowns in forms, not other 
displays such as in the grid and read-only forms (for that, you also need 
to set the "represent" attribute), and (b) you have to explicitly set the 
above for every reference field that references auth_user. If you instead 
use the _format method, you get the validator and the "represent" attribute 
automatically for every reference field that references auth_user.

Anthony 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to