def gen_xml_coordinator(request): response = {'status': -1} coordinator_dict = json.loads(request.POST.get('coordinator', '{}')) coordinator = Coordinator(data=coordinator_dict) response['status'] = 0 response['xml'] = coordinator.to_xml() return JsonResponse(response)
def gen_xml_coordinator(request): response = {'status': -1} coordinator_dict = json.loads(request.POST.get('coordinator', '{}')) coordinator = Coordinator(data=coordinator_dict) response['status'] = 0 response['xml'] = coordinator.to_xml() return HttpResponse(json.dumps(response), mimetype="application/json")