> > db.define_table('drench', > Field('status', requires=IS_IN_SET(STATUSES), > default=STATUSES[0]), > Field('assigned_to', db.auth_user), #, default=auth.user_id > Field('start_date', 'date',default=request.now), > Field('completed_date', 'date',default=request.now), > Field('mob',db.stock), > Field('count'), > Field('estimated_weight','integer', default=0), > > Field('product',requires=IS_IN_DB(db,db.product.product_name, > '%(product_name)s %(batch_no)s')), >
You have defined the "product" field as a string field, not a reference field. The default representation of a string field in a grid or read-only form is simply the string itself. If you want a different representation, you must specify the "represent" attribute of the field. The IS_IN_DB validator is used to generate a select widget in forms, so the "label" argument you specified in that validator controls that values shown in the select widget, but that has no effect on the representation in grids and read-only forms. Anthony -- 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.