Пример #1
0
import sys, traceback
from datetime import datetime

@frontend.route('/games', methods=['GET', 'POST'])
def games():
    if request.method == 'POST':
        try:
            games = dgdb.games(search_term=request.form['search_field'])
        except Exception, e:
            flash(e.message)
            return redirect(url_for('frontend.index'))
        search=request.form['search_field']
        return render_template("games.html", games=games, search=search)
    else: 
        try:
            games =  dgdb.get_games()
        except Exception, e:
            flash(e.message)
            return redirect(url_for('frontend.index'))
        games =  dgdb.get_games()
        search = "GET"
        return render_template("games.html", games=games, search=search)
    

    #return render_template("games.html", games=games)

@frontend.route('/game/<int:id>/', methods=['GET'])
def game(id):
    try:
        game = dgdb.game(id)
    except Exception, e:
Пример #2
0
def index():
    print "games"
    games = dgdb.get_games()
    #search = "GET"
    return render_template("games.html", games=games, search="GET")
Пример #3
0
def index():
    print "games"
    games = dgdb.get_games()
    #search = "GET"
    return render_template("games.html", games=games, search="GET")
Пример #4
0
from datetime import datetime


@frontend.route('/games', methods=['GET', 'POST'])
def games():
    if request.method == 'POST':
        try:
            games = dgdb.games(search_term=request.form['search_field'])
        except Exception, e:
            flash(e.message)
            return redirect(url_for('frontend.index'))
        search = request.form['search_field']
        return render_template("games.html", games=games, search=search)
    else:
        try:
            games = dgdb.get_games()
        except Exception, e:
            flash(e.message)
            return redirect(url_for('frontend.index'))
        games = dgdb.get_games()
        search = "GET"
        return render_template("games.html", games=games, search=search)

    #return render_template("games.html", games=games)


@frontend.route('/game/<int:id>/', methods=['GET'])
def game(id):
    try:
        game = dgdb.game(id)
    except Exception, e: