-
Notifications
You must be signed in to change notification settings - Fork 1
/
GamesHandler.py
30 lines (27 loc) · 910 Bytes
/
GamesHandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from google.appengine.ext import webapp
from google.appengine.api import users
from google.appengine.ext.webapp import template
from models import *
import os
import logging
class GamesHandler(webapp.RequestHandler):
def get(self):
games = GameModel.gql('ORDER BY ordinal')
user = users.get_current_user()
if user:
loginurl = users.create_logout_url(self.request.uri)
loginurl_text = "Logout..."
else:
loginurl = users.create_login_url(self.request.uri)
loginurl_text = "Login"
template_stuff = {'user': user,
'loginurl': loginurl,
'loginurl_text': loginurl_text,
'games': games,
'isAdmin': users.is_current_user_admin(),
#'punter': punter,
#'bets': bets,
#'leaderboard': leaderboard,
}
path = os.path.join(os.path.dirname(__file__), 'templates/games.html')
self.response.out.write(template.render(path, template_stuff))