コード例 #1
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def ftournaments():
    with dbapi2.connect(app.config['dsn']) as connection:
        _tourList = dbmanager.getTournaments(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('Snooker is about having the best offensive play possible.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('ftournament.html', tournamentList = _tourList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
コード例 #2
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
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)
コード例 #3
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
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)
コード例 #4
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def ftickets():
    with dbapi2.connect(app.config['dsn']) as connection:
        _ticketList = dbmanager.getTickets(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('If you go step by step, with confidence, you can go far.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('ftickets.html', ticketList = _ticketList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
コード例 #5
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def news():
    with dbapi2.connect(app.config['dsn']) as connection:
        _newsList = dbmanager.getNews(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('All about Snooker','Daily News for Snooker','static/img/home-bg.jpg')
        return render_template('fnews.html', newsList = _newsList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
コード例 #6
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def fplayers():
    with dbapi2.connect(app.config['dsn']) as connection:
        _playerList = dbmanager.getPlayers(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('The game of snooker has been everything to me.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('fplayers.html', playerList = _playerList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
コード例 #7
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def newsDetail(newsid):
    with dbapi2.connect(app.config['dsn']) as connection:
        _news = dbmanager.getNewsWithID(newsid,connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo(_news.getTitle(),'',_news.getImageUrl())
        _comments = dbmanager.getComments(newsid,connection)
        return render_template('/fnews_detail.html',news = _news, info = _info, commentList = _comments, sponsorList = _sponsorList, channelList = _channelList)
コード例 #8
0
ファイル: server.py プロジェクト: itucsdb1504/itucsdb1504
def channel():
    with dbapi2.connect(app.config['dsn']) as connection:
        if(request.method == 'GET'):
            _channelList = dbmanager.getChannels(connection)
            return render_template('channel.html', channelList = _channelList)

        if(request.form["action"] == "Add Channel"):
            dbmanager.addChannel(request.form['add_channel_name'], request.form['add_channel_imageurl'], request.form['add_channel_exturl'], connection)
            return redirect(url_for('channel'))

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

        return render_template('channel.html')