This is a rather old post, but it still was involved in finding a solution 
to a similar problem, which I came across:

Am Montag, 17. Mai 2010 11:44:20 UTC+2 schrieb Andrew Buchan:
>
> My question is, how do I get a read-only form to display the 
> Department_Name instead of the id of the referenced record?


SQLFORM.factory readonly form does not display the format-string as 
specified in the referenced table, if in readonly mode.

The following article held the answer: 
https://groups.google.com/d/msg/web2py/Kmb2r__HFJo/OwBhg7g4gkQJ

I specified a represent attribute. According the above examples, that would 
look something like:

Field('To_Department', type=db.department, represent=lambda id: db.
department._format % db.department[id]),

Perhaps this helps someone in the future.

Kind regards, Mac

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to