Exemple #1
0
def fmatches():
    with dbapi2.connect(app.config['dsn']) as connection:
        _matchList = dbmanager.getMathes(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('Looking for perfection is the only way.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('fmatches.html', matchList = _matchList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
Exemple #2
0
def addMatch():
    with dbapi2.connect(app.config['dsn']) as connection:
        if(request.method == 'GET'):
            _matchList = dbmanager.getMathes(connection)
            return render_template('match.html', matchList = _matchList)

        if(request.form["action"] == "Add Match"):
            dbmanager.addMatch(request.form['add_tournamentName'], request.form['add_venueName'], request.form['add_player1'],request.form['add_player2'], request.form['add_isLive'], request.form['add_score'],connection)
            return redirect(url_for('addMatch'))

        if(request.form["action"] == "Delete"):
            dbmanager.deleteVideo(request.form['id'], connection)
            return redirect(url_for('addMatch'))

        return render_template('match.html')