def hrm_training_year(row):
 if hasattr(row, 'hrm_training'):
  row = row.hrm_training
 try:
  date = row.date
 except AttributeError:
  date = None
 if date:
  return date.year
 else:
  return current.messages['NONE']

def hrm_training_year ( row ) : if hasattr ( row , 'hrm_training' ) : row = row . hrm_training try : date = row . date except AttributeError : date = None if date : return date . year else : return current . messages [ 'NONE' ]
the year of the training event .