コード例 #1
0
def leaderboardhub(gamename):
    scoretypes = hub.query_db(
        'SELECT leaderboard.name FROM leaderboard WHERE leaderboard.gamename = ?',
        [gamename])
    if len(scoretypes) > 1:
        return render_template('leaderboardgame.html', entries=scoretypes)
    else:
        return redirect('/leaderboards/' + gamename + '/' + scoretypes[0][0])
コード例 #2
0
def blog_route():
    entries = hub.query_db(
        "SELECT * FROM article ORDER BY postDate DESC LIMIT 3")
    return render_template('bloghub.html', entries=entries)
コード例 #3
0
def spesific_article(article_id):
    article = hub.query_db("SELECT * FROM article WHERE id = ?", [article_id],
                           one=True)
    print(article)
    return render_template("article.html", entries={'article': article})
コード例 #4
0
def leaderboards():
    games = hub.query_db('SELECT * FROM lb_game')
    return render_template('leaderboards.html', entries=games)
コード例 #5
0
def leaderboard(gamename, scoretype):
    scores = hub.query_db(
        'SELECT time_submitted, username, value FROM score WHERE score.typename = ? AND score.gamename = ?',
        [scoretype, gamename])
    return render_template('leaderboard.html', entries=scores)
コード例 #6
0
def leaderboards():
    games = hub.query_db('SELECT * FROM lb_game')
    return render_template('leaderboards.html', entries=games)
コード例 #7
0
def leaderboard(gamename, scoretype):
    scores = hub.query_db(
        'SELECT time_submitted, username, value FROM score WHERE score.typename = ? AND score.gamename = ?',
        [scoretype, gamename])
    return render_template('leaderboard.html', entries=scores)
コード例 #8
0
def leaderboardhub(gamename):
    scoretypes = hub.query_db('SELECT leaderboard.name FROM leaderboard WHERE leaderboard.gamename = ?', [gamename])
    if len(scoretypes) > 1:
        return render_template('leaderboardgame.html', entries=scoretypes)
    else:
        return redirect('/leaderboards/' + gamename + '/' + scoretypes[0][0])
コード例 #9
0
ファイル: BlogAPI.py プロジェクト: Polarbirds/polarbirdshub
def blog_route():
    entries = hub.query_db("SELECT * FROM article ORDER BY postDate DESC LIMIT 3")
    return render_template('bloghub.html', entries=entries)
コード例 #10
0
ファイル: BlogAPI.py プロジェクト: Polarbirds/polarbirdshub
def spesific_article(article_id):
    article = hub.query_db("SELECT * FROM article WHERE id = ?", [article_id], one=True)
    print(article)
    return render_template("article.html", entries={'article': article})