コード例 #1
0
    def GET(self, id):
        if not session.get('logged_in', False):
            raise web.HTTPError("401 unauthorized", {}, "unauthorized")

        id = int(id)
        model.del_todo(id)
        web.header('Content-Type', 'application/json')
        result = {'result':'ok'}
        return json.dumps(result)
コード例 #2
0
ファイル: todo.py プロジェクト: mozillazg/webpy-code-examples
 def GET(self, id):
     id = int(id)
     model.del_todo(id)
     raise web.seeother('/')
コード例 #3
0
ファイル: todo.py プロジェクト: kennyfrc/pybasics
 def POST(self, id):
     """ Delete based on ID """
     id = int(id)
     model.del_todo(id)
     raise web.seeother('/')
コード例 #4
0
ファイル: todo.py プロジェクト: wyrover/Scrapy-Examples-1
 def POST(self, id):
     id=int(id)
     model.del_todo(id)
     raise web.seeother('/')
コード例 #5
0
ファイル: todo.py プロジェクト: 492852238/SourceLearning
 def POST(self, id):
     """ Delete based on ID """
     id = int(id)
     model.del_todo(id)
     raise web.seeother('/')
コード例 #6
0
ファイル: todo.py プロジェクト: ShoJinto/webpy-learn
 def POST(self, id):  # 定义POST方法,接收一个参数传入,此参数是从web.input过来
     '''DELETE BASED ON ID'''
     id = int(id)  # 做数据类型转换是为了是传递过来的参数和数据库里的类型相符合
     model.del_todo(id)
     raise web.seeother('/')
コード例 #7
0
 def POST(self, id):
     """Delete based on primary key field id in db """
     model.del_todo(id)
     raise web.seeother('/')
コード例 #8
0
 def POST(self, id):
     print("开始删除--->", id)
     id = int(id)
     model.del_todo(id)
     raise web.seeother("/")
コード例 #9
0
ファイル: todo.py プロジェクト: nianyuguai/Python
 def POST(self,base_id):
     '''delete based on ID'''
     b_id = int(base_id)
     model.del_todo(b_id)
     #重定向链接
     raise web.seeother('/nianyuguai')