forked from hpsin/fwf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViews.py
38 lines (30 loc) · 1.01 KB
/
Views.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
31
32
33
34
35
36
37
38
import webapp2
import os
from google.appengine.ext.webapp import template
from dbClasses import Event
from dbClasses import AppUser
from google.appengine.ext import db
from google.appengine.api import users
class ViewUser(webapp2.RequestHandler):
def get(self):
userKey=self.request.path[6:] #Chops off the end of the request path to get the user key
user=AppUser.get_by_key_name(userKey)
nickname=user.id.nickname()
currentUser = AppUser.getUser()
template_values = {
'nickname':nickname,
'user':user,
'events':[]
}
#Displays:
#Username (nickname)
#Good/bad event counts
#Verified status
#Events (later)
path = os.path.join(os.path.dirname(__file__), './templates/viewUser.html')
self.response.out.write(template.render(path, template_values))
class ViewEvent(webapp2.RequestHandler):
def get(self):
eventKey=self.request.path[6:] #Chops off the end of the request path to get the user key
event=Event.get(eventKey)
templateValues