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})
def del_post_tag_view(request): post_id = request.POST['post_id'] tag_id = request.POST['tag_id'] post_type = request.POST['post_type'] error, msg = info_manager.delete_post_tag(tag_id, post_id, post_type) return json_http_response({'error': error, 'error_msg': msg})
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''})
def get_post_view(request, post_id): info = info_manager.get_post(post_id) return json_http_response(info)
def hot_post_view(request): hot_info = info_manager.get_hot_posts() return json_http_response(hot_info)
def user_comments_view(request): user = get_user_by_request(request) info = info_manager.build_user_comments_info(user) return json_http_response(info)
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)
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})