def POST(self): form = xh_form() if not form.validates(): return render.score(form=form) else: xh = form.d.xh from addons import get_gpa, get_score gpa = get_gpa(xh) score = get_score(xh) return render.old_result(score_table=score, jidian=gpa['ave_score'])
def POST(self): form = xh_form() if not form.validates(): return render.score(form=form) else: xh = form.d.xh from addons import get_gpa, get_score gpa=get_gpa(xh) score=get_score(xh) return render.old_result(score_table=score, jidian=gpa['ave_score'])
def GET(self, t): if session['logged_in'] == False: raise web.seeother('/login') time_md5 = session['time_md5'] try: zf, xh, time_start = find_login(time_md5) except KeyError: return render.key_error() if t == '4': # 全部成绩 return render.result(score_table=get_score(xh)) elif t == '5': # 往年cet table = get_old_cet(xh) return render.result(cet_table=table) elif t == "1": # 成绩 try: table = zf.get_score() except AttributeError: return render.key_error() elif t == "2": # 考试时间 try: table = zf.get_kaoshi() except AttributeError: return render.key_error() elif t == "3": # 课表 try: table = zf.get_kebiao() except AttributeError: return render.key_error() else: return render.input_error() if table: return render.result(table=table) else: error = "can not find your index table" return render.result(error=error)
def GET(self, t): if session['logged_in']==False: raise web.seeother('/login') time_md5=session['time_md5'] try: zf, xh, time_start = find_login(time_md5) except KeyError: return render.key_error() if t == '4': # 全部成绩 return render.result(score_table=get_score(xh)) elif t == '5': # 往年cet table=get_old_cet(xh) return render.result(cet_table=table) elif t == "1": # 成绩 try: table = zf.get_score() except AttributeError: return render.key_error() elif t == "2": # 考试时间 try: table = zf.get_kaoshi() except AttributeError: return render.key_error() elif t == "3": # 课表 try: table = zf.get_kebiao() except AttributeError: return render.key_error() else: return render.input_error() if table: return render.result(table=table) else: error = "can not find your index table" return render.result(error=error)