def patient():
 tablename = 'patient_patient'
 s3db.table('patient_patient')
 s3db.configure(tablename, create_next=URL(args=['[id]', 'relative']))
 def prep(r):
  if r.id:
   s3db.configure('patient_relative', create_next=URL(args=[str(r.id), 'home']))
  return True
 s3.prep = prep
 def postp(r, output):
  s3_action_buttons(r, deletable=False)
  return output
 s3.postp = postp
 tabs = [(T('Basic Details'), None), (T('Accompanying Relative'), 'relative'), (T('Home'), 'home')]
 rheader = (lambda r: patient_rheader(r, tabs=tabs))
 output = s3_rest_controller(rheader=rheader)
 return output

def patient ( ) : tablename = 'patient_patient' s3db . table ( 'patient_patient' ) s3db . configure ( tablename , create_next = URL ( args = [ '[id]' , 'relative' ] ) ) def prep ( r ) : if r . id : s3db . configure ( 'patient_relative' , create_next = URL ( args = [ str ( r . id ) , 'home' ] ) ) return True s3 . prep = prep def postp ( r , output ) : s3_action_buttons ( r , deletable = False ) return output s3 . postp = postp tabs = [ ( T ( 'Basic Details' ) , None ) , ( T ( 'Accompanying Relative' ) , 'relative' ) , ( T ( 'Home' ) , 'home' ) ] rheader = ( lambda r : patient_rheader ( r , tabs = tabs ) ) output = s3_rest_controller ( rheader = rheader ) return output
restful crud controller .