Example #1
0
def show_match_page(match_id):
    cur = g.db.execute(
        """SELECT mp.participant_id, p.name, mp.kills, mp.deaths,
                        mp.assists, c.img_url, t.team_name, s1.img_url, s2.img_url, mp.item_set FROM 
                        match_participant AS mp, summoners AS s1, summoners AS s2, 
                        playerinfo AS p, champions AS c, teams as t
                        WHERE mp.match_id =  ? AND 
                        s1.id = mp.spell_id_one AND
                        s2.id = mp.spell_id_two AND
                        p.player_id = mp.player_id AND 
                        c.id = mp.champion AND t.team_id = mp.team_id
                        ORDER BY mp.participant_id""", [int(match_id)])
    m = [
        dict(participant_id=row[0],
             name=row[1],
             kills=row[2],
             deaths=row[3],
             assists=row[4],
             img_url=row[5],
             team_name=row[6],
             spell1=row[7],
             spell2=row[8],
             item_set=json.loads(row[9]),
             safe_set=row[9]) for row in cur.fetchall()
    ]
    version = riot_api.get_version()
    return render_template('match.html',
                           match=m,
                           version=version,
                           dropdown=get_dropdown_menu())
Example #2
0
def show_league_matches(league_id):
    query = " and match_details.region_id = %s " % str(league_id)
    m = get_list_of_matches(query)
    version = riot_api.get_version()
    return render_template('matches.html',
                           matches=m,
                           version=version,
                           dropdown=get_dropdown_menu())
Example #3
0
def show_match_page(match_id):
    cur = g.db.execute("""SELECT mp.participant_id, p.name, mp.kills, mp.deaths,
                        mp.assists, c.img_url, t.team_name, s1.img_url, s2.img_url, mp.item_set FROM 
                        match_participant AS mp, summoners AS s1, summoners AS s2, 
                        playerinfo AS p, champions AS c, teams as t
                        WHERE mp.match_id =  ? AND 
                        s1.id = mp.spell_id_one AND
                        s2.id = mp.spell_id_two AND
                        p.player_id = mp.player_id AND 
                        c.id = mp.champion AND t.team_id = mp.team_id
                        ORDER BY mp.participant_id""", [int(match_id)])
    m = [dict(participant_id = row[0], name = row[1], kills = row[2],
            deaths = row[3], assists = row[4], img_url = row[5], 
            team_name = row[6], spell1 = row[7], spell2 = row[8],
            item_set = json.loads(row[9]), safe_set = row[9]) for row in cur.fetchall()]
    version = riot_api.get_version()
    return render_template('match.html', match = m, version = version, dropdown = get_dropdown_menu())
Example #4
0
def show_league_matches(league_id):
    query = " and match_details.region_id = %s " % str(league_id)
    m = get_list_of_matches(query)
    version = riot_api.get_version()
    return render_template('matches.html', matches = m, version = version, dropdown = get_dropdown_menu())