forked from psawaya/Cam-Mash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cam_mash.py
47 lines (37 loc) · 970 Bytes
/
cam_mash.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
39
40
41
42
43
44
45
46
47
from google.appengine.api import users
from google.appengine.ext import db
from vendor import web
from models import *
from ChatUser import ChatUser
urls = (
'/', 'index',
'/list', 'list',
'/listen', 'listen',
'/call', 'call'
)
render = web.template.render('templates', base='base')
class index:
def GET(self):
user = users.get_current_user()
return render.index()
def POST(self):
i = web.input()
person = Person()
person.name = i.name
person.put()
return web.seeother('/list')
class listen:
def GET(self):
# return "Error."
return render.listen()
def POST(self):
return render.listen()
class call:
def GET(self):
return render.call()
class list:
def GET(self):
people = db.GqlQuery("SELECT * FROM Person ORDER BY created DESC LIMIT 10")
return render.list(people)
app = web.application(urls, globals())
main = app.cgirun()