>
> I will not see the f_contact as a name anymore but only as the ids. 
> When I remove the requires from the table definition the ids are resolved 
> to the names again.
>

Sorry, I forgot -- for reference fields, if you don't specify any 
validators, it gets a default IS_IN_DB validator, and it also gets a 
default "represent" attribute. When you explicitly specify your own 
IS_IN_DB validator, it no longer automatically gets the "represent" 
attribute, so you have to set that yourself as well. Something like:

db.define_table('t_customer_contact', 
    Field('f_customer', db.t_customer, label=T("customer")),
    Field('f_contact', db.auth_user, label=T("contact"),
        requires=IS_IN_DB(db(query), 'auth_user.id', format=db.auth_user.
_format),
        represent=lambda id, r: '%(first_name) %(last_name)' % db.auth_user(
id)),
    [etc.]

Anthony

Reply via email to