public
Description: Just add the appengine SDK, then take over the world
Homepage: http://overstimulate.com
Clone URL: git://github.com/anotherjesse/webpy-appengine-helloworld.git
anotherjesse (author)
Sat Oct 11 16:20:44 -0700 2008
commit  b019a3c7e34fcdcffb30f796ee7de5f057be08db
tree    d669e2947f15da09b7dfd6072d572ee8c15895d7
parent  c3fa2d0f6594167c8c59916b08b3057c83671033
100755 29 lines (23 sloc) 0.613 kb
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
from google.appengine.ext import db
from vendor import web
from models import *
 
urls = (
  '/', 'index',
  '/list', 'list'
)
 
render = web.template.render('templates', base='base')
 
class index:
    def GET(self):
        return render.index()
    def POST(self):
        i = web.input()
        person = Person()
        person.name = i.name
        person.put()
        return web.seeother('/list')
 
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()