def deploy_mission_response_count(row):
 if hasattr(row, 'deploy_mission'):
  row = row.deploy_mission
 try:
  mission_id = row.id
 except AttributeError:
  return 0
 db = current.db
 table = db.deploy_response
 count = table.id.count()
 row = db((table.mission_id == mission_id)).select(count).first()
 if row:
  return row[count]
 else:
  return 0

def deploy_mission_response_count ( row ) : if hasattr ( row , 'deploy_mission' ) : row = row . deploy_mission try : mission_id = row . id except AttributeError : return 0 db = current . db table = db . deploy_response count = table . id . count ( ) row = db ( ( table . mission_id == mission_id ) ) . select ( count ) . first ( ) if row : return row [ count ] else : return 0
number of responses to a mission .