Omi, In this : db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label)
I don't understand where you are going... You try to set a represent over table KR_Product for field Grade right? But you get you represent value from another table KR_GradeLabel... In case of a represent the lambda value is the field content for a given record... So you Name lambda passed variable may sure not containing what you think or want it contains... I don't see in your model definition that KR_Product.Grade to be actually a reference field... Model not saying so and field name neither... Richard On Thu, Feb 5, 2015 at 3:09 PM, Omi Chiba <ochib...@gmail.com> wrote: > I'm using 2.4.7 released 2013.05.24 so it could be bug and fixed now but I > need to work on this version for now because I have issue with the latest > web2py. Anyway, I found this > https://groups.google.com/forum/#!searchin/web2py/IS_IN_DB$20readonly/web2py/uBBcvthCDl8/Z7s872JW47IJ > > and tried something > > db.KR_Product.Grade.represent = lambda Name: > SPAN(db.KR_GradeLabel[Name].Label) > > but I got a error says > > <type 'exceptions.AttributeError'>('Table' object has no attribute 'P') > > Which P is the key value. And I want to shop P = Precision from another > table. > > > On Thursday, February 5, 2015 at 1:48:48 PM UTC-6, Omi Chiba wrote: >> >> I tried edit mode and put the following script in the view which works >> but feels so stupid and user cannot copy the values which I have to allow >> them top copy and paste. >> >> <script> >> jQuery(document).ready(function(){ >> jQuery('#main').find('input, select').attr("readonly", true); >> }); >> </script> >> >> On Thursday, February 5, 2015 at 11:22:49 AM UTC-6, Omi Chiba wrote: >>> >>> In another word, it shows fine when I use {{=form.custom.widget.Grade}} >>> with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) >>> but not when I do readonly=True >>> >>> >> -- > 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. > -- 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.