def edit_auth(request, uuid): """ add auth :param request: :return: """ uuid = str(uuid) group_uuid = auth_group.objects.get(uuid=uuid) if request.method == 'POST': uf = cmdb_from(request.POST, instance=group_uuid) if uf.is_valid(): uf.save() return HttpResponse( json.dumps( { "status": 200, "msg": "ok" }, ensure_ascii=False, indent=4, )) else: data = cmdb_from(instance=group_uuid) return render_to_response('auth/jquery_from.html', locals(), context_instance=RequestContext(request))
def cmdb_auth(request): data = cmdb_from() if request.method == 'POST': uf = cmdb_from(request.POST) if uf.is_valid(): uf.save() return HttpResponseRedirect("/auth/cmdb/") return render_to_response('auth/cmdb.html', locals(), context_instance=RequestContext(request)) else: return render_to_response('auth/cmdb.html', locals(), context_instance=RequestContext(request))
def edit_auth(request, uuid): """ add auth :param request: :return: """ uuid = str(uuid) group_uuid = auth_group.objects.get(uuid=uuid) if request.method == 'POST': uf = cmdb_from(request.POST, instance=group_uuid) if uf.is_valid(): uf.save() return HttpResponse(json.dumps({"status": 200, "msg": "ok"}, ensure_ascii=False, indent=4, )) else: data = cmdb_from(instance=group_uuid) return render_to_response('auth/jquery_from.html', locals(), context_instance=RequestContext(request))