def POST(self): """接收mission_id,""" if session.login == 1: if session.user: try: m = mission.mission_view(web.input().mission_id) return render_template( type=session.type, template_name='modify_mission.html', user=session.user, mission_view=m, error="修改任务") except Exception, e: print e return render_template( type=session.type, template_name='modify_mission.html', user=session.user, mission_view=m, error="出现未知错误,请重试" ) #通过mission_id获取任务信息,作为表单的默认值返回给modify_mission.html #最后多了一个参数mission_id else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self ,args): if session.login == 1: if session.user: mission_list = mission.mission_view(account_name = session.user, role=web.input().type, mission_status='待接受') sission_list = mission.mission_view(account_name = session.user, role=web.input().type, mission_status='已提交') wission_list = mission.mission_view(account_name = session.user, role=web.input().type, mission_status='未通过') yission_list = mission.mission_view(account_name = session.user, role=web.input().type, mission_status='已完成') #当已建任务动态为空时,防止卡死 if not mission_list and not sission_list and not wission_list and not yission_list : mission_list=sission_list=wission_list=yission_list=[{}] return render_template(type=session.type, \ template_name='mission_state.html', \ user=session.user, \ mission_list = mission_list, \ wission_list = wission_list, \ sission_list = sission_list, \ yission_list = yission_list, \ role = web.input().type) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self,arg): if session.login == 1: if session.user: arg = web.input() m = mission.mission_view(arg.mission_id) return render_template( type=session.type,template_name='view_'+arg.type+'.html', user=session.user, mission_view=m) #返回m,m[0]['mission_name'], m[0]['mission_content']等等 else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self, args): if session.login == 1: if session.user: args = web.input() print args.mission_id, unquote(args.mission_status) mission.mission_sta_change(args.mission_id, unquote(args.mission_status)) m = mission.mission_view(args.mission_id) return render_template( type=session.type,template_name='view_mission.html', user=session.user, mission_view=m) #返回m,m[0]['mission_name'], m[0]['mission_content']等等 else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self,arg): if session.login == 1: if session.user: arg = web.input() m = mission.mission_view(arg.mission_id) return render_template( type=session.type, template_name='modify_mission.html', user=session.user, mission_view=m, error="") else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self,arg): if session.login == 1: if session.user: arg = web.input() m = mission.mission_view(arg.mission_id) print "m = mission.mission_view(arg.mission_id)" return render_template( type=session.type, template_name='modify_mission.html', user=session.user, mission_view=m, error="") else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self ,args): if session.login == 1: if session.user: mission_list = mission.mission_view(account_name = session.user, role=web.input().type, mission_status=web.input().status) #当已建任务动态为空时,防止卡死 if not mission_list: mission_list = [{'mission_doer':''}] if str(web.input().type) == 'mission_doer': mission_doer = session.user elif str(web.input().type) == 'mission_publisher': mission_doer = mission_list[0]['mission_doer'] else: mission_doer = session.user return render_template(type=session.type, \ template_name='mission_state.html', \ user=session.user, \ mission_list = mission_list, \ role = web.input().type,\ mission_sta = web.input().mission_sta,\ mission_doer = mission_doer ) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})