def index(request): """ 主页的处理函数, 返回主页的响应 """ u = current_user(request) body = Template.render('index.html', username=u.username) return html_response(body)
def index(request): result = request.query.get('result', '') result = unquote_plus(result) u = current_user(request) todos = Todo.all() # 替换模板文件中的标记字符串 body = Template.render('todo_index.html', todos=todos, result=result) return html_response(body)
def index(request): """ weibo 首页的路由函数 """ u = current_user(request) weibos = Weibo.find_all(user_id=u.id) log('weiboall', weibos) # 替换模板文件中的标记字符串 body = Template.render('weibo_index.html', weibos=weibos) return html_response(body)
def edit(request): user_id = int(request.query['id']) u = User.find_by(id=user_id) cu = current_user(request) body = Template.render( 'user_edit.html', username=cu.username, user=u, ) return html_response(body)
def login_view(request): u = current_user(request) result = request.query.get('result', '') result = unquote_plus(result) body = Template.render( 'user_login.html', username=u.username, result=result, ) return html_response(body)
def admin(request): result = request.query.get('result', '') result = unquote_plus(result) u = current_user(request) us = User.all() body = Template.render( 'user_admin.html', username=u.username, users=us, result=result, ) return html_response(body)
def index(request): """ weibo 首页的路由函数 """ body = Template.render('weibo_index.html') return html_response(body)
def register_view(request): result = request.query.get('result', '') result = unquote_plus(result) body = Template.render('user_register.html', result=result) return html_response(body)
def edit(): weibo_id = int(request.query['id']) w = Weibo.find_by(id=weibo_id) body = Template.render('weibo_edit.html', weibo=w) return html_response(body)
def edit(request): todo_id = int(request.query['id']) t = Todo.find_by(id=todo_id) body = Template.render('todo_edit.html', todo=t) return html_response(body)