Пример #1
0
def frecords():
    with dbapi2.connect(app.config['dsn']) as connection:
        _recordList = dbmanager.getRecords(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('Never mind what others do; do better than yourself.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('frecords.html', recordList = _recordList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
Пример #2
0
def addRecord():
    with dbapi2.connect(app.config['dsn']) as connection:
        if(request.method == 'GET'):
            _recordList = dbmanager.getRecords(connection)
            return render_template('record.html', recordList = _recordList)

        if(request.form["action"] == "add_record_action"):
            dbmanager.addRecord(request.form['record_desc'], request.form['player_name'], request.form['video_url'],request.form['record_date'] ,connection)
            return redirect(url_for('addRecord'))

        if(request.form["action"] == "delete_record_action"):
            dbmanager.deleteRecord(request.form['id'], connection)
            return redirect(url_for('addRecord'))

        return render_template('record.html')