Hi All, I have been pulling my hair out with this. Wen I view the drenches grid I shows the assigned to = the full name of the auth user which is correct , but when I add a product it only displays the name of the product and does not include the batch no which I require. I am lost as to why.
Thanks Anthony I have the following tables: db.define_table('product', Field('product_name'), Field('active_ingredient'), Field('batch_no'), Field('expiry_date','date',default = request.now), Field('product_type', requires=IS_IN_SET(PRODUCTTYPES),default= PRODUCTTYPES[0]), Field('product_usage', requires=IS_IN_SET(PRODUCTSUBTYPES),default= PRODUCTSUBTYPES[0]), Field('withholding_period','integer',requires=[IS_NOT_EMPTY()]), Field('ESI_withholding','integer',requires=[IS_NOT_EMPTY()]), Field('qty','integer'), Field('date_purchased','date', default = request.now), Field('purchased_from', requires=IS_IN_DB(db,'person.company','%(company)s')), auth.signature, format='%(product_name)s %(batch_no)s') 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')), Field('dose_rate'), Field('withhold_until_date', 'date'), Field('ESI_withhold_until_date', 'date'), Field('paddock', requires=IS_IN_DB(db,db.paddock.paddock_name,'%(paddock_name)s')), auth.signature) In my controller I am using the following: def manage_stock_tasks(): grid = SQLFORM.smartgrid(db.stock,linked_tables=['drench','vaccinate','joining', 'marking','feeding','footbath'], user_signature=False) return dict(grid=grid) def drench(): form= SQLFORM.factory( Field('status', requires=IS_IN_SET(STATUSES), default=STATUSES[0]), Field('assigned_to', requires=IS_IN_DB(db.auth_user.id,'%(first_name)s %(last_name)s')), Field('start_date', 'date',default=request.now), Field('completed_date', 'date',default=request.now), Field('mob',requires=IS_IN_DB(db,db.stock.id,'%(mob_name)s')), Field('count'), Field('estimated_weight','integer', default=0), Field('product', requires=IS_IN_DB(db.product.id,'%(product_name)s %(batch_no)s')), Field('dose_rate','integer'), Field('withhold_until_date', 'date'), Field('ESI_withhold_until_date', 'date'), #default=withheld), # need to use the completed date and product withhold peroid Field('paddock', requires=IS_IN_DB(db,db.paddock.id,'%(paddock_name)s'))) -- 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.