def POST(self, tablename, itemid):
     if logged():
         try:
             table = alltable[tablename]
             model.del_item(table, int(itemid))
             raise web.seeother('/index_item/' + table[0])
         except:
             render = create_render(0)
             return render.error('已被细项包含,无法删除!')
     else:
         raise web.seeother('/')
 def POST(self, cid, pid):
     if logged():
         c = model.get_item(alltable['class'], int(cid))
         if c['approve'] == u'未审批':
             model.del_item(alltable['class'], int(cid))
             if pid == '':
                 raise web.seeother('/index_class/')
             else:
                 raise web.seeother('/index_class_project/' + pid)
         else:
             render = create_render(0)
             return render.error('细项已审批,不能删除!')
     else:
         raise web.seeother('/')
 def POST(self, pid):
     if logged():
         classes_project = list(
             model.get_classes('where class.pid=' + str(pid)))
         if len(classes_project) != 0:
             approval = [a['approve'] for a in classes_project]
             if approval == [u'未审批'] * len(approval):
                 for c in classes_project:
                     model.del_item(alltable['class'], int(c['cid']))
                 model.del_item(alltable['project'], int(pid))
                 raise web.seeother('/index_project')
             else:
                 render = create_render(0)
                 return render.error('细项已审批,不能删除!')
         else:
             model.del_item(alltable['project'], int(pid))
             raise web.seeother('/index_project')
     else:
         raise web.seeother('/')
Exemple #4
0
 def POST(self,tablename,itemid):
     table=alltable[tablename]
     model.del_item(table,int(itemid))
     raise web.seeother('/index/'+table[0])
Exemple #5
0
 def POST(self,cid,pid):
     table=alltable['class']
     model.del_item(table,int(cid))
     raise web.seeother('/index_class/'+pid)
Exemple #6
0
 def POST(self,pid):
     table=alltable['project']
     model.del_item(table,int(pid))
     raise web.seeother('/index_project')
Exemple #7
0
 def POST(self, id):
     """Delete based on ID"""
     id = int(id)
     model.del_item(id)
     raise web.seeother('/admin')
Exemple #8
0
 def POST(self, cid, pid):
     model.del_item(alltable['class'], int(cid))
     if pid == '':
         raise web.seeother('/index_class/')
     else:
         raise web.seeother('/index_class_project/' + pid)