def education():
 def prep(r):
  if (r.method in ('create', 'create.popup', 'update', 'update.popup')):
   person_id = get_vars.get('~.person_id', None)
   if person_id:
    field = s3db.pr_education.person_id
    field.default = person_id
    field.readable = field.writable = False
  return True
 s3.prep = prep
 return s3_rest_controller('pr', 'education')

def education ( ) : def prep ( r ) : if ( r . method in ( 'create' , 'create.popup' , 'update' , 'update.popup' ) ) : person_id = get_vars . get ( '~.person_id' , None ) if person_id : field = s3db . pr_education . person_id field . default = person_id field . readable = field . writable = False return True s3 . prep = prep return s3_rest_controller ( 'pr' , 'education' )
restful crud controller .