def _process_log_to_dict(process_log):
 if ((not process_log) or (not process_log.total_stages)):
  return {}
 else:
  return {'process_id': process_log.id, 'process_name': process_log.process_name, 'process_percent': process_log.process_percent, 'stage_name': process_log.stage_name, 'stage_percent': process_log.stage_percent, 'stage_status': process_log.stage_status, 'cur_stage_num': (1 + int(math.floor((process_log.total_stages * process_log.process_percent)))), 'total_stages': process_log.total_stages, 'notes': process_log.notes, 'completed': (process_log.completed or (process_log.end_time is not None))}

def _process_log_to_dict ( process_log ) : if ( ( not process_log ) or ( not process_log . total_stages ) ) : return { } else : return { 'process_id' : process_log . id , 'process_name' : process_log . process_name , 'process_percent' : process_log . process_percent , 'stage_name' : process_log . stage_name , 'stage_percent' : process_log . stage_percent , 'stage_status' : process_log . stage_status , 'cur_stage_num' : ( 1 + int ( math . floor ( ( process_log . total_stages * process_log . process_percent ) ) ) ) , 'total_stages' : process_log . total_stages , 'notes' : process_log . notes , 'completed' : ( process_log . completed or ( process_log . end_time is not None ) ) }
utility function to convert a process log to a dict .