Am 17.06.2012 02:07, schrieb Anthony:
>
> 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
> <http://auth_user.id/>',format=db.auth_user._format),
> represent=lambdaid,r:'%(first_name)
> %(last_name)'%db.auth_user(id)),
> [etc.]
>
> Anthony
>
Hello Anthony,great. Now it works (%(first_name)s). I wonder were I should have read and understood this in the first place. Thanks and kind regards Cornelius
signature.asc
Description: OpenPGP digital signature

