Created
August 21, 2012 00:38
-
-
Save naoyeye/3409951 to your computer and use it in GitHub Desktop.
登录部分
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_account(show='all',login_form=login_form()): | |
return view.base(view.account(show, login_form), user, site_name) | |
class login: | |
def GET(self): | |
return render_account(show='login_only') | |
def POST(self): | |
f = self.form() | |
if not f.validates(web.input(_unicode=False)): | |
show = web.input(show='all').show | |
return render_account(show, login_form=f) | |
else: | |
session.login(f.d.email) | |
raise web.seeother('/') | |
def form(self): | |
return login_form() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment