Ejemplo n.º 1
0
def del_comment_post_view(request):
    post_id = request.POST['post_id']
    post_type = request.POST['post_type']
    user = get_user_by_request(request)

    error, msg = info_manager.del_comment_post(user.id, post_id, post_type)
    return json_http_response({'error': error, 'error_msg': msg})
Ejemplo n.º 2
0
def create_post_view(request):
    content = request.POST['content']
    user = get_user_by_request(request)

    db_manager.create_post_db(content=content, author_id=user.id)
    return json_http_response({'error': 0, 'error_msg': u''})
Ejemplo n.º 3
0
def user_participate_posts_and_articles_view(request):
    user = get_user_by_request(request)
    info = info_manager.build_user_participate_posts_and_article_info(user)
    return json_http_response(info)
Ejemplo n.º 4
0
def user_comments_view(request):
    user = get_user_by_request(request)
    info = info_manager.build_user_comments_info(user)
    return json_http_response(info)
Ejemplo n.º 5
0
def create_post_tag_view(request):
    tag_content = request.POST['content']
    user = get_user_by_request(request)

    error, msg = info_manager.create_tag(user, tag_content)
    return json_http_response({'error': error, 'error_msg': msg})