Re: [web2py] Re: form.custom.dspval and IS_IN_DB

2015-02-05 Thread Omi Chiba
OK, I don't like this but this is only way to do. I can look up the table in the view. What a mess Grade : {{grade = db.KR_GradeLabel(db.KR_GradeLabel.Name==form.custom.dspval.Grade)}} {{if grade:}} {{=grade.Label}} {{else:}} {{=form.custom.dspval.G

Re: [web2py] Re: form.custom.dspval and IS_IN_DB

2015-02-05 Thread Omi Chiba
Thank you for the reply. I'm not really sure how to use lamda. The problem is IS_IN_DB doesn't work when it's readonly and I found requires only works for Create/Edit and need to use represent for readonly view. I think this is a bug and should be it's already fixed but doen't matter to me beca

Re: [web2py] Re: form.custom.dspval and IS_IN_DB

2015-02-05 Thread Richard Vézina
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 rep