def handle(self,ri): if ri.isFinal and ri.thisComp == 'startDemo': return common.getResult(resume.DepartmentInfo.handle_startDemo()) elif ri.isFinal: dept = resume.DepartmentInfo.selectBy(shortname=ri.thisComp) if dept.count() > 0: return common.HttpResult('Moved Permanently',status=301,Location=ri.req.uri+'/') if ri.thisComp == '': return common.HttpFileResult(os.path.join(config.serverRoot,'static-base','index.html')) return common.handleFile(os.path.join(config.serverRoot,'static-base'),ri)
def handle(self,ri): if ri.isFinal and ri.thisComp == '': return common.HttpFileResult(os.path.join(config.serverRoot,'static','login.html')) if ri.isFinal: try: return common.ObjHandler.handle(self,ri) except common.HandlerException: pass if ri.thisComp[:7] == 'letter-' and ri.thisComp[-4:] == '.pdf': return common.getResult(ri.extras['dept'].handle_getLetter(id=int(ri.thisComp[7:-4]))) return common.handleFile(os.path.join(config.serverRoot,'static'),ri)
def handle(self,ri): applicant = resume.Applicant.cSelectOne(ri.extras['dept'],auth=ri.auser) if applicant is None: raise common.HandlerException('Can\'t get this application!') if not ri.isFinal: raise common.HandlerException('Method Not Found!') if applicant.submitterHandlers.has_key(ri.thisComp): meth = resume.Applicant.submitterHandlers[ri.thisComp].__get__(applicant,applicant.__class__) return common.getResult(ri.applyFields(meth)) else: raise common.HandlerException('Method Not Found!')