def hrm_training_organisation(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
  query = ((table.person_id == person_id) & (table.status != 2))
  orgs = current.db(query).select(table.organisation_id, distinct=True)
  if orgs:
   output = ''
   represent = s3db.org_OrganisationRepresent()
   for org in orgs:
    repr = represent(org.organisation_id)
    if output:
     output = ('%s, %s' % (output, repr))
    else:
     output = repr
   return output
 return current.messages['NONE']

def hrm_training_organisation ( 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 query = ( ( table . person_id == person_id ) & ( table . status != 2 ) ) orgs = current . db ( query ) . select ( table . organisation_id , distinct = True ) if orgs : output = '' represent = s3db . org_OrganisationRepresent ( ) for org in orgs : repr = represent ( org . organisation_id ) if output : output = ( '%s, %s' % ( output , repr ) ) else : output = repr return output return current . messages [ 'NONE' ]
which organisation(s)/branch the person is actively affiliated with .