I have a table Lab_members:
db.define_table('lab_members',
Field('member',db.auth_user,
represent=lambda member,row: str(member.username)
),
)
and now I create a second table, having a Field:
Field('member',db.lab_members,label='Lab member',
represent=lambda member,row:
db.auth_user(member).username,
requires=IS_IN_DB(db((db.lab_members.lab==auth.user_id)),
field='lab_members.member',
label='%(member)s',
)
My problem is, how to set the label in the IS_IN_DB validator, as to
display in the dropdown list the usernames and not the user.id ?
After the selection, the usernames are displayed properly (through the
represent function of the field).
Is there any solution?
--