예제 #1
0
def index(request):
    """
    weibo 首页的路由函数
    """
    # 替换模板文件中的标记字符串
    body = GuaTemplate.render('weibo_api_index.html')
    return html_response(body)
예제 #2
0
def index(request):
    """
    主页的处理函数, 返回主页的响应
    """
    u = current_user(request)
    body = GuaTemplate.render('index.html', username=u.username)
    return html_response(body)
예제 #3
0
def route_admin_users(request):
    u = current_user(request)
    if u.admin():
        us = User.all()
        body = GuaTemplate.render('admin_users.html', users=us)
        return html_response(body)
    else:
        return redirect('/')
예제 #4
0
def index(request):
    """
    todo 首页的路由函数
    """
    u = current_user(request)
    todos = Todo.find_all(user_id=u.id)
    # 替换模板文件中的标记字符串
    body = GuaTemplate.render('todo_index.html', todos=todos)
    return html_response(body)
예제 #5
0
def index(request):
    """
    weibo 首页的路由函数
    """
    # u = current_user(request)
    # weibos = Weibo.find_all(user_id=u.id)
    # 替换模板文件中的标记字符串
    body = GuaTemplate.render('weibo_index.html')
    return html_response(body)
예제 #6
0
def login_view(request):
    u = current_user(request)
    result = request.query.get('result', '')
    result = unquote_plus(result)

    body = GuaTemplate.render(
        'login.html',
        username=u.username,
        result=result,
    )
    return html_response(body)
예제 #7
0
def edit(request):
    weibo_id = int(request.query['id'])
    w = Weibo.find_by(id=weibo_id)
    body = GuaTemplate.render('weibo_edit.html', weibo=w)
    return html_response(body)
예제 #8
0
def edit(request):
    todo_id = int(request.query['id'])
    t = Todo.find_by(id=todo_id)
    body = GuaTemplate.render('todo_edit.html', todo=t)
    return html_response(body)
예제 #9
0
def register_view(request):
    result = request.query.get('result', '')
    result = unquote_plus(result)

    body = GuaTemplate.render('register.html', result=result)
    return html_response(body)
예제 #10
0
def index(request):
    """
    todo 首页的路由函数
    """
    body = GuaTemplate.render('todo_index.html')
    return html_response(body)