def mission_p_edit(request,template="admin/config/mission_p/edit.tpl"): mp = MissionProbability() p_list = mp.get_p_list() if request.method == "GET": return render_response(template,p_list=p_list) elif request.method == "POST": try: for p in p_list: p.value = request.POST.get(p.key) mp.p_list = p_list mp.save_data() except Exception,e: if config.debug: print e else: return HttpResponse("<script type='text/javascript'>window.top.right.location.reload();window.top.art.dialog({id:'config_mission_p_edit'}).close();</script>")
def mission_p_list(request,template="admin/config/mission_p/list.tpl"): mp = MissionProbability() p_list = mp.get_p_list() if p_list: return render_response(template,p_list=p_list) return render_response(template,p_list=None)