def edit(request):
    """
    todo 首页的路由函数
    """
    todo_id = int(request.query['id'])
    t = Todo.one(id=todo_id)
    return html_response('todo_edit.html', todo_id=todo_id, todo_title=t.title)
Exemple #2
0
def index(request):
    """
    todo 首页的路由函数
    """
    u = current_user(request)
    ts = Todo.find_all(user_id=u.id)
    return html_response('todo_index.html', todos=ts)
def route_register_view(request):
    user = current_user(request)
    result = request.query.get('result', '')
    result = urllib.parse.unquote_plus(result)
    return html_response('register.html',
                         result=result,
                         username=user.username)
Exemple #4
0
def index(request):
    """
    weibo 首页的路由函数
    """
    u = current_user(request)
    ws = Weibo.find_all(user_id=u.id)
    return html_response('weibo_index.html', weibos=ws, user=u)
Exemple #5
0
def edit(request):
    """
    todo 首页的路由函数
    """
    # 替换模板文件中的标记字符串
    todo_id = int(request.query['id'])
    t = Todo.find_by(id=todo_id)
    return html_response('todo_edit.html', todo_id=todo_id, todo_title=t.title)
Exemple #6
0
def index(request):
    """
    weibo 首页的路由函数
    """
    u = current_user(request)
    weibos = Weibo.all(user_id=u.id)
    # 替换模板文件中的标记字符串
    return html_response('weibo_index.html', weibos=weibos, user=u)
def index(request):
    """
    weibo 首页的路由函数
    """
    if 'user_id' in request.query:
        user_id = int(request.query['user_id'])
    else:
        u = current_user(request)
        user_id = u.id
    weibos = Weibo.all(user_id=user_id)
    return html_response('weibo_index.html', weibos=weibos)
Exemple #8
0
def index(request):
    """
    weibo 首页的路由函数
    """
    if 'user_id' in request.query:
        user_id = int(request.query['user_id'])
    else:
        u = current_user(request)
        user_id = u.id
    weibos = Weibo.all(user_id=user_id)
    for w in weibos:
        print('w.dict', w.__dict__)
    # 替换模板文件中的标记字符串
    return html_response('weibo_index.html', weibos=weibos)
def route_login_view(request):
    """
    登录页面视图
    """

    log('login, headers', request.headers)
    log('login, cookies', request.cookies)
    user = current_user(request)
    log('current user', user)

    result = request.query.get('result', '')
    result = urllib.parse.unquote_plus(result)

    return html_response('login.html', result=result, username=user.username)
Exemple #10
0
def comment_edit(request):
    comment_id = int(request.query['comment_id'])
    c = Comment.one(id=comment_id)
    return html_response('comment_edit.html', comment=c)
Exemple #11
0
def edit(request):
    weibo_id = int(request.query['weibo_id'])
    w = Weibo.one(id=weibo_id)
    return html_response('weibo_edit.html', weibo=w)
def index(request):
    """
    todo 首页的路由函数
    """
    u = current_user(request)
    return html_response('ajax_todo_index.html')
Exemple #13
0
def message_view(request):
    ms = Message.all()
    return html_response('messages.html', messages=ms)
Exemple #14
0
def route_ajax(request):
    """
    主页的处理函数, 返回主页的响应
    """
    return html_response('ajax.html')