Exemple #1
0
def delete_comment(request):
    """
    通过下面这样的链接来删除一个 todo
    /delete?id=1
    """
    id = int(request.query.get('id'))
    t = Comment.delete(id)
    return json_response(t.json())
Exemple #2
0
def delete_comment(request):
    """
    通过下面这样的链接来删除一个 comment
    /delete?id=1
    """
    comment_id = int(request.query.get('id'))
    w = Comment.delete(comment_id)
    return json_response(w.json())
Exemple #3
0
def delete_comment(request):
    """
    通过下面这样的链接来删除一个 todo
    /delete?id=1
    """
    comment_id = int(request.query.get('id'))
    c = Comment.delete(comment_id)
    cs = Comment.find_all(weibo_id=c.weibo_id)  # 加载属于该微博的所有comment
    cs_list = [c.json() for c in cs]  # 每一个对象转成dict
    return json_response(cs_list)
Exemple #4
0
def delete_comment(request):
    """
    通过下面这样的链接来删除一个 comment
    先不考虑权限认证的问题
    /delete?id=1
    """
    comment_id = int(request.query.get('id'))
    t = Comment.delete(comment_id)
    return json_response(t.json())
    pass
Exemple #5
0
def delete_weibo(request):
    """
    通过下面这样的链接来删除一个 weibo及其comments
    /delete?id=1
    """
    weibo_id = int(request.query.get('id'))
    w = Weibo.delete(weibo_id)  # 删除这个weibo
    cs = w.comments()
    for c in cs:
        cdel = Comment.delete(c.id)  # 删除这个weibo关联的所有commnets
    return json_response(w.json())
Exemple #6
0
def delete_comment(request):
    comment_id = int(request.query.get('id'))
    c = Comment.delete(comment_id)
    return json_response(c.json())
Exemple #7
0
def comment_delete_weibo(request):
    cmt_id = int(request.query.get('id'))
    # print('cmt_id', cmt_id)
    cmt = Comment.delete(cmt_id)
    return json_response(cmt.json())