from google appengine ext import db from google appengine api import u

 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
from google.appengine.ext import db
from google.appengine.api import users
from vendor import web
from models import *
urls = (
## '/', 'index',
'/add', 'add'
)
render = web.template.render('templates', base='base')
class add:
def GET(self):
user = users.get_current_user()
if user:
name = user.nickname()
logout = users.create_logout_url("/")
return render.add(name, logout)
else:
login = users.create_login_url("/add")
return render.notlogin(login)
##
##def POST(self):
## i = web.input()
## person = Person()
## person.name = i.name
## person.put()
## return web.seeother('/list')
app = web.application(urls, globals())
main = app.cgirun()