def req_skill():
 s3.filter = (FS('req_id$is_template') == False)
 def prep(r):
  if (r.interactive or (r.representation == 'aadata')):
   list_fields = s3db.get_config('req_req_skill', 'list_fields')
   list_fields.insert(1, 'req_id$site_id')
   list_fields.insert(1, 'req_id$site_id$location_id$L4')
   list_fields.insert(1, 'req_id$site_id$location_id$L3')
   s3db.configure('req_req_skill', insertable=False, list_fields=list_fields)
   if ((r.method != 'update') and (r.method != 'read')):
    s3db.req_hide_quantities(r.table)
  return True
 s3.prep = prep
 def postp(r, output):
  if r.interactive:
   s3.actions = [dict(url=URL(c='req', f='req', args=['req_skill', '[id]']), _class='action-btn', label=str(READ))]
  return output
 s3.postp = postp
 return s3_rest_controller('req', 'req_skill')

def req_skill ( ) : s3 . filter = ( FS ( 'req_id$is_template' ) == False ) def prep ( r ) : if ( r . interactive or ( r . representation == 'aadata' ) ) : list_fields = s3db . get_config ( 'req_req_skill' , 'list_fields' ) list_fields . insert ( 1 , 'req_id$site_id' ) list_fields . insert ( 1 , 'req_id$site_id$location_id$L4' ) list_fields . insert ( 1 , 'req_id$site_id$location_id$L3' ) s3db . configure ( 'req_req_skill' , insertable = False , list_fields = list_fields ) if ( ( r . method != 'update' ) and ( r . method != 'read' ) ) : s3db . req_hide_quantities ( r . table ) return True s3 . prep = prep def postp ( r , output ) : if r . interactive : s3 . actions = [ dict ( url = URL ( c = 'req' , f = 'req' , args = [ 'req_skill' , '[id]' ] ) , _class = 'action-btn' , label = str ( READ ) ) ] return output s3 . postp = postp return s3_rest_controller ( 'req' , 'req_skill' )
rest controller @todo: filter out fulfilled skills? .