Skip to content

Instantly share code, notes, and snippets.

@naoyeye
Created August 21, 2012 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naoyeye/3409951 to your computer and use it in GitHub Desktop.
Save naoyeye/3409951 to your computer and use it in GitHub Desktop.
登录部分
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