Esempio n. 1
0
def index(request):
    """
    todo 首页的路由函数
    """
    u = current_user(request)
    todos = Todo.find_all(user_id=u.id)
    # 替换模板文件中的标记字符串
    return html_response('todo_index.html', todos=todos)
Esempio n. 2
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)
Esempio n. 3
0
def login_view(request):
    u = current_user(request)
    result = request.query.get('result', '')
    result = unquote_plus(result)

    return html_response(
        'login.html',
        username=u.username,
        result=result,
    )
def index(request):
    """
    weibo 首页的路由函数
    """
    if 'id' in request.query:
        user_id = int(request.query['id'])
        u = User.one(id=user_id)
    else:
        u = current_user(request)

    weibos = Weibo.all(user_id=u.id)
    # 替换模板文件中的标记字符串
    return html_response('weibo_index.html', weibos=weibos, user=u)
Esempio n. 5
0
def edit(request):
    todo_id = int(request.query['id'])
    t = Todo.find_by(id=todo_id)
    return html_response('todo_edit.html', todo=t)
def index(request):
    """
    主页的处理函数, 返回主页的响应
    """
    u = current_user(request)
    return html_response('index.html', username=u.username)
def comment_edit(request):
    comment_id = int(request.query['id'])
    c = Comment.one(id=comment_id)
    log('in the comment_edit', c)
    return html_response('comment_edit.html', comment=c)
def edit(request):
    weibo_id = int(request.query['id'])
    w = Weibo.one(id=weibo_id)
    return html_response('weibo_edit.html', weibo=w)
Esempio n. 9
0
def comment_edit(request):
    comment_id = int(request.query['id'])
    t = Comment.one(id=comment_id)
    return html_response('comment_edit.html', comment=t)
Esempio n. 10
0
def register_view(request):
    result = request.query.get('result', '')
    result = unquote_plus(result)

    return html_response('register.html', result=result)
Esempio n. 11
0
def index(request):

    u = current_user(request)
    return html_response('todo_ajax_index.html')