def hrm_experience_controller():
 if (current.session.s3.hrm.mode is not None):
  current.session.error = current.T('Access denied')
  redirect(URL(f='index'))
 def prep(r):
  if (r.method in ('create', 'update')):
   field = current.s3db.hrm_experience.person_id
   person_id = current.request.get_vars.get('~.person_id', None)
   if person_id:
    field.default = person_id
    field.readable = field.writable = False
   elif (r.method == 'update'):
    refresh = r.get_vars.get('refresh')
    if (refresh and refresh.startswith('profile-list-hrm_experience')):
     field.readable = field.writable = False
  return True
 current.response.s3.prep = prep
 output = current.rest_controller('hrm', 'experience')
 return output

def hrm_experience_controller ( ) : if ( current . session . s3 . hrm . mode is not None ) : current . session . error = current . T ( 'Access denied' ) redirect ( URL ( f = 'index' ) ) def prep ( r ) : if ( r . method in ( 'create' , 'update' ) ) : field = current . s3db . hrm_experience . person_id person_id = current . request . get_vars . get ( '~.person_id' , None ) if person_id : field . default = person_id field . readable = field . writable = False elif ( r . method == 'update' ) : refresh = r . get_vars . get ( 'refresh' ) if ( refresh and refresh . startswith ( 'profile-list-hrm_experience' ) ) : field . readable = field . writable = False return True current . response . s3 . prep = prep output = current . rest_controller ( 'hrm' , 'experience' ) return output
experience controller .