I want to display the value from IS_IN_DB. I have "P" as value and display 
"P = Precision" from the table. It's working fine on Edit mode in admin. 
But when I display the values, form.custom.dspval and form.custom.inpval 
shows the same value "P". Any idea?


*My View*
{{=form.custom.begin}}
<table>
<tbody>
<tr>
    <td class="w2p_fw"><label>Grade</label></td>
    <td class="w2p_fw" >: {{=form.custom.widget.Grade}}</td>
</tr>
</table>

{{=form.custom.end}}

*My model*

db.define_table('KR_Product',
    Field('ProductCode', length=15),
    Field('PartNumber', length=50),
    Field('Grade', length=1),
    Field('Cover', length=1),
    Field('Sensor', length=1),
    Field('Housing', length=1),
    Field('Flange', length=1),
    Field('Description', length=500)
    )

db.KR_Product.Grade.requires=IS_IN_DB(db,'KR_GradeLabel.Name','%(Label)s')

db.define_table('KR_GradeLabel',
    Field('Name', length=1),
    Field('Label', length=50),
    primarykey=['Name']
    )
 

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to