def create_match_bout( match_id ): match = find_match( match_id ) bout_data = request.data del bout_data['current_round'] bout_data = reassign_bout( bout_data ) match.individual_bouts.append( bout_data ) match.save() return json.dumps( match, default=remove_OIDs)
def save_wrestler_action(match_id, bout_id, wrestler_id, activity): """ Good candidate to start using some memcache or redis here """ match = find_match( match_id ) bout = find_bout( match, bout_id ) activity.actor = wrestler_id bout.rounds.append( activity ) match.save() return json.dumps( activity, default=remove_OIDs )
def get_single_bout(match_id, bout_id): match = find_match( match_id ) bout = find_bout( match, bout_id ) return json.dumps( bout[0], default=remove_OIDs )
def get_single_match(match_id): match = find_match( match_id) return json.dumps( match, default=remove_OIDs)