db.define_table('pm_events',
                Field('eqp_id', 'reference pm_equip'),
                Field('lc_no', 'reference 
dblc.lc_vw_lc_master.lc_no'),                
                Field('pending_work', type='string'),
                Field('remarks', type='string'),
                Field('completed', type='string', 
length=1,required='True',notnull='True'),
                
Field('update_uid','string',length=6,required='True',notnull='True',default 
= session.uname),
                
Field('update_dt','datetime',required='True',notnull='True',default=request.now)
)


dblc.define_table('lc_vw_lc_master',
                Field('lc_no', 
type='string',length=11,required='True',notnull='True'),
                Field('unit_descr',type='string'),
                Field('btg_descr',type='string'),
                Field('sys_descr',type='string'),
                Field('eqp_descr',type='string'),
                Field('lc_from',type='datetime'),
                Field('lc_to',type='datetime'),
                Field('work_descr',type='string'),
                Field('lc_req_uname',type='string', length=11),
                Field('lc_statue',type='string'),
                Field('lc_req_dt',type='datetime'),
                Field('lc_issue_uname',type='string', length=11),
                Field('lc_issue_dt',type='datetime'),
                primarykey=['lc_no'],
                migrate=False)

db.define_table('pm_equip',
                Field('equipment_id', 'integer'),
                Field('equipment_no', 'string', length = 25),
                Field('equipment_detail','string'),
                Field('division_id', 'integer'),
                Field('location_id', 'reference pm_location'),
                Field('subdivision_id', 'integer'),
                Field('divn', 'string',length = 10),
                Field('rep_code', 'string', length = 10)
               )
db.define_table('pm_location',
                Field('location_id', 'integer'),
                Field('location_name', 'string')
                )

I have the above tables in db.py
Now in controller pm_events.py I want to have a form for pm_events which 
has reference to pm_equip which in turn has reference to pm_location.
In the create form for pm_events on the selection of equipment it should 
show the location of the equipment and user enters other details and 
submits the form. 
How to achieve this functionality, may be in a smart grid.
Thank you for the time.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2f1ae9c8-a967-443f-b0f4-197ab4f869e3o%40googlegroups.com.

Reply via email to