db.table.To_Department.represent=lambda v:
db.department[v].Department_Name

or better remove  requires = IS_IN_DB(db, db.department.id, '%
(Department_Name)s'
and set

db.define_table('department',....,format='%(Department_Name)s')



On May 17, 4:44 am, Andrew Buchan <[email protected]> wrote:
> Hi all,
> If I have a referenced field where I specify which field in the referenced 
> table to display, like so:
> Field('To_Department', requires = IS_IN_DB(db, db.department.id, 
> '%(Department_Name)s')),
> SQLFORM generates a form with a drop-down box showing me the Department_Name 
> of the departments, but only if it is an INSERT or UPDATE form.
> My question is, how do I get a read-only form to display the Department_Name 
> instead of the id of the referenced record?
> Can't seem to find an example or answer on the web, but there must surely be 
> an easy way...
> Thanks,Andy.
>
> _________________________________________________________________http://clk.atdmt.com/UKM/go/197222280/direct/01/
> Do you have a story that started on Hotmail? Tell us now

Reply via email to