def hrm_training_month(row):
 if hasattr(row, 'hrm_training'):
  row = row.hrm_training
 try:
  date = row.date
 except AttributeError:
  date = None
 if date:
  return ('%s/%02d' % (date.year, date.month))
 else:
  return current.messages['NONE']

def hrm_training_month ( row ) : if hasattr ( row , 'hrm_training' ) : row = row . hrm_training try : date = row . date except AttributeError : date = None if date : return ( '%s/%02d' % ( date . year , date . month ) ) else : return current . messages [ 'NONE' ]
year/month of the start date of the training event .