def get_match_info(match_id): match_info = connect.query_one( cur, 'SELECT * FROM game_info WHERE id_odsp = ' + to_str(match_id)) match_commentary = connect.query_mul( cur, 'SELECT * FROM events WHERE id_odsp = ' + to_str(match_info['id_odsp'])) return match_info, match_commentary
def get_match_info(team1, team2, season): match_info = connect.query_one( cur, 'SELECT * FROM game_info WHERE ht = ' + to_str(team1) + ' AND at = ' + to_str(team2) + ' AND season = ' + season) match_commentary = connect.query_mul( cur, 'SELECT * FROM events WHERE id_odsp = ' + to_str(match_info['id_odsp'])) return match_info, match_commentary
def get_team_names(): team_names = connect.query_mul( cur, 'SELECT DISTINCT ht, league FROM game_info ORDER BY league, ht') name_string = '' for i, name in enumerate(team_names): if i - 1 < len(team_names): name_string += name['league'] + ':' + name['ht'] + '\n' else: name_string += name['league'] + ':' + name['ht'] return name_string
def get_matches(): team_names = connect.query_mul( cur, 'SELECT season FROM game_info WHERE ht = ' + to_str(team1) + ' AND at = ' + to_str(team2) + ' ORDER BY season') name_string = '' for i, name in enumerate(team_names): if i - 1 < len(team_names): name_string += str(name['season']) + '\n' else: name_string += str(name['season']) return name_string
def get_match_ids(): match_ids = connect.query_mul(cur, 'SELECT DISTINCT id_odsp FROM game_info') return match_ids
def get_events(game_id): team_names = connect.query_mul( cur, 'SELECT * FROM events WHERE id_odsp = ' + to_str(game_id) + ' ORDER BY sort_order') return team_names