Guys i need help here, I have an insurance database that has 3 tables of 
information that relates to the client (account holder), what i want to do 
is to be able to group each piece of information according to its owner 
(account holder) in an html table in the view and not have it mixed up. 
Have client A details in row 1, client A children details in row 2 and 
client A parents information in the following row. From there client B and 
his information in the subsequent rows then client C & so on. How can i 
achieve this??

*MODELS*


















*db.define_table('client',                Field('gender', 
requires=IS_IN_SET(['Mr', 'Mrs', 'Miss'], zero='---Select Gender---')),    
            Field('last_name', requires=IS_NOT_EMPTY()),                
Field('first_name', requires=IS_NOT_EMPTY()),                
Field('id_number', requires = IS_MATCH('^\d{9}?$', error_message='An ID 
Number should have exactly 9 digits')))db.define_table('children',          
      Field('client', 'reference client', writable=False),                
Field('gender', requires=IS_IN_SET(['Male', 'Female', 'None'], 
zero='---Select Gender---')),                Field('childs_full_names', 
requires=IS_NOT_EMPTY()),                Field('dob', 'date', 
requires=IS_NOT_EMPTY()),              
 )db.define_table('parents_and_in_laws',                Field('client', 
'reference client', writable=False),                Field('gender', 
requires=IS_IN_SET(['Mr', 'Mrs', 'Miss', 'None'], zero='---Select 
Gender---')),                Field('full_name', requires=IS_NOT_EMPTY()),  
              Field('id_number', requires = IS_MATCH('^\d{9}?$', 
error_message='An ID Number should have exactly 9 digits')),                
Field('relationship', requires=IS_NOT_EMPTY()))*

*Controller:*





*def client_policy_packages():    
nuclear=db(db.newclear_family.).select(db.newclear_family.ALL)    
children=db(db.children).select(db.children.ALL)    
parent=db(db.parents_and_in_laws).select(db.parents_and_in_laws.ALL)    
extended=db(db.extended_family).select(db.extended_family.ALL)    return 
locals()*

*View:*

*------------------------*

-- 
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/8851b60f-3ade-415f-a16a-a3ca47ef352an%40googlegroups.com.

Reply via email to