def hrm_training_job_title(row):
 try:
  person_id = row.hrm_training.person_id
 except AttributeError:
  person_id = None
 if person_id:
  s3db = current.s3db
  table = s3db.hrm_human_resource
  jtable = s3db.hrm_job_title
  query = (((table.person_id == person_id) & (table.status != 2)) & (table.job_title_id == jtable.id))
  jobs = current.db(query).select(jtable.name, distinct=True, orderby=jtable.name)
  if jobs:
   output = ''
   for job in jobs:
    repr = job.name
    if output:
     output = ('%s, %s' % (output, repr))
    else:
     output = repr
   return output
 return current.messages['NONE']

def hrm_training_job_title ( row ) : try : person_id = row . hrm_training . person_id except AttributeError : person_id = None if person_id : s3db = current . s3db table = s3db . hrm_human_resource jtable = s3db . hrm_job_title query = ( ( ( table . person_id == person_id ) & ( table . status != 2 ) ) & ( table . job_title_id == jtable . id ) ) jobs = current . db ( query ) . select ( jtable . name , distinct = True , orderby = jtable . name ) if jobs : output = '' for job in jobs : repr = job . name if output : output = ( '%s, %s' % ( output , repr ) ) else : output = repr return output return current . messages [ 'NONE' ]
which job titles(s) the person is active with .