def get_group_info(num, group): group['ranking'] = num group['section'] = group['wins'] + group['draws'] + group['loses'] team_info = TeamService.get_one(group['team_id']) if team_info: group['team_name'] = team_info['name'] group['team_badge'] = team_info['badge'] return group
def get_info(num, scorer): if scorer['player_id']: player = PlayerService.get_one(scorer['player_id']) scorer['player_photo'] = player['photo'] scorer['player_name'] = player['name'] team_info = TeamPlayerService.get_filter_one(scorer['player_id']) if team_info: scorer['team_id'] = team_info['team_id'] team = TeamService.get_one(team_info['team_id']) if team: scorer['team_name'] = team['name'] scorer['ranking'] = num return scorer
def get_team_info(group): team_info = TeamService.get_one(group['team_id']) if team_info: group['team_name'] = team_info['name'] group['team_badge'] = team_info['badge'] score = ScoreboardService.get_filter_one(group['event_id'], group['team_id']) if score: group['id'] = score['id'] group['wins'] = score['wins'] group['draws'] = score['draws'] group['loses'] = score['loses'] group['goals_differential'] = score['goals_differential'] group['points'] = score['points'] group['section'] = group['wins'] + group['draws'] + group['loses'] return group
def get_selected_team(group): team_info = TeamService.get_one(group['team_id']) if team_info: group['name'] = team_info['name'] return group
def get_team_info(team): team = TeamService.get_one(team['team_id']) team['name'] = team['name'] return team