Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
def get_match_ids():
	match_ids = connect.query_mul(cur, 'SELECT DISTINCT id_odsp FROM game_info')
	return match_ids
Ejemplo n.º 6
0
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