#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 
import web
import time
from bson.objectid import ObjectId
from config import setting
import helper

db = setting.db_web

# 删除聊天规则

url = ('/plat/index_news_remove')

class handler:

    def GET(self):
        if not helper.logged(helper.PRIV_USER, 'TALKBOT'):
            raise web.seeother('/')

        render = helper.create_render()
        user_data = web.input(news_id='')

        if user_data.news_id == '': 
            return render.info('参数错误！')  

        db.index_news.delete_one({'_id':ObjectId(user_data.news_id)})

        return render.info('成功删除！', '/plat/index_news')


[((363, 385), 'helper.create_render', 'helper.create_render', ([], {}), '()\n', (383, 385), False, 'import helper\n'), ((406, 427), 'web.input', 'web.input', ([], {'news_id': '""""""'}), "(news_id='')\n", (415, 427), False, 'import web\n'), ((265, 307), 'helper.logged', 'helper.logged', (['helper.PRIV_USER', '"""TALKBOT"""'], {}), "(helper.PRIV_USER, 'TALKBOT')\n", (278, 307), False, 'import helper\n'), ((327, 344), 'web.seeother', 'web.seeother', (['"""/"""'], {}), "('/')\n", (339, 344), False, 'import web\n'), ((549, 576), 'bson.objectid.ObjectId', 'ObjectId', (['user_data.news_id'], {}), '(user_data.news_id)\n', (557, 576), False, 'from bson.objectid import ObjectId\n')]