def POST(self): #需要接收mission_id if session.login == 1: if session.user: mission_id = web.input().mission_id #先添加任务,再把原来的任务删除 #创建任务 try: mission_duplicate = web.input().mission_duplicate except Exception, e: mission_duplicate = "off" #检查输入信息 result = mission.mission_check(web.input().mission_name, \ web.input().mission_content, web.input().mission_starttime, web.input().mission_plan_end_time) if result == "no error": #存储任务信息 mission.mission_save(web.input().mission_name, session.user, \ web.input().mission_content, web.input().mission_starttime, \ web.input().mission_plan_end_time, mission_duplicate) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') #return render.my_mission(session.user, mission_list) ajax_result = {"statusCode":"200", "message":"任修改成功", "callbackType":"closeCurrent"} try: result_del = mission.mission_delete(mission_id) except Exception, e: print e finally: mission_list = mission.mission_list(account_name=session.user, role='mission_publisher')
def POST(self): #需要接收mission_id if session.login == 1: if session.user: mission_id = web.input().mission_id #先添加任务,再把原来的任务删除 #创建任务 try: mission_duplicate = web.input().mission_duplicate except Exception, e: mission_duplicate = "off" #检查输入信息 result = mission.mission_check(web.input().mission_name, \ web.input().mission_content, web.input().mission_starttime, web.input().mission_plan_end_time) if result == "no error": #存储任务信息 mission.mission_save(web.input().mission_name, session.user, \ web.input().mission_content, web.input().mission_starttime, \ web.input().mission_plan_end_time, mission_duplicate) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') #return render.my_mission(session.user, mission_list) ajax_result = {"statusCode":"200", "message":"任务修改成功", "callbackType":"closeCurrent"} try: result_del = mission.mission_delete(mission_id) except Exception, e: print e finally: mission_list = mission.mission_list(account_name=session.user, role='mission_publisher')
def POST(self): mission_id = web.input().mission_id if session.login==1: if session.user: result = mission.mission_delete(mission_id) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') return render_template(type=session.type, template_name='my_mission.html', user=session.user, mission_list=mission_list) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def POST(self): mission_id = web.input().mission_id #mission_status = web.input().mission_status print mission_id if session.login==1: if session.user: result = mission.mission_delete(mission_id) #mission_list = mission.mission_list(account_name=session.user, role='mission_publisher',mission_status=mission_status) return json.dumps({"statusCode":"200", "message":"删除成功!"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})