def GET(self, cid):
     if logged():
         c = model.get_classes('where cid=' + cid)[0]
         classes = model.get_conflict_class(c)
         date = c['begindate'].strftime('%Y-%m')
         render = create_render(session.privilege)
         return render.conflict_class(classes, date, cid)
     else:
         raise web.seeother('/')
 def GET(self,pid):
     classes = list(model.get_classes('where class.pid='+str(pid)+' order by ctime DESC'))
     for c in classes:
         conflict_class = model.get_conflict_class(c)
         if len(conflict_class)==1:
             c['conflict'] = 0
         else:
             c['conflict'] = 1
     render = create_render(session.privilege)
     return render.index_class_project(classes,pid,datetime.datetime.now().strftime('%Y-%m'))
 def GET(self, term):
     if logged():
         if session.privilege == 3:
             user = '******' + str(session.uid)
             if term == '':
                 classes = list(
                     model.get_classes(user + ' order by ctime DESC'))
             elif term == 'unapprove':
                 classes = list(
                     model.get_classes(
                         user + ' and approve=\'未审批\' order by ctime DESC'))
             elif term == 'pass':
                 classes = list(
                     model.get_classes(
                         user + ' and approve=\'通过\' order by ctime DESC'))
             elif term == 'notpass':
                 classes = list(
                     model.get_classes(
                         user + ' and approve=\'不通过\' order by ctime DESC'))
             for c in classes:
                 conflict_class = model.get_conflict_class(c)
                 if len(conflict_class) == 1:
                     c['conflict'] = 0
                 else:
                     c['conflict'] = 1
         elif session.privilege == 2:
             if term == '':
                 classes = model.get_classes('order by ctime DESC')
             elif term == 'unapprove':
                 classes = model.get_classes(
                     'where approve=\'未审批\' order by ctime DESC')
             elif term == 'pass':
                 classes = model.get_classes(
                     'where approve=\'通过\' order by ctime DESC')
             elif term == 'notpass':
                 classes = model.get_classes(
                     'where approve=\'不通过\' order by ctime DESC')
         render = create_render(session.privilege)
         return render.index_class(
             classes,
             datetime.datetime.now().strftime('%Y-%m'))
     else:
         raise web.seeother('/')
 def GET(self,cid):
     c = model.get_classes('where cid='+cid)[0]
     classes = model.get_conflict_class(c)
     date = classes[0]['begindate'].strftime('%Y-%m')
     render = create_render(session.privilege)
     return render.conflict_class(classes,date,cid)