def project_view(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) pr_bundle = pr.build_bundle(obj=project, request=request) return render_to_response( "rundb/data/modal_project_details.html", { # Other things here. "project_json": pr.serialize(None, pr.full_dehydrate(pr_bundle), 'application/json'), "project": project, "method": "GET", "readonly": True, 'action': reverse('api_dispatch_detail', kwargs={ 'resource_name': 'project', 'api_name': 'v1', 'pk': int(pk) }, args={'format': 'json'}) })
def project_edit(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) pr_bundle = pr.build_bundle(obj=project, request=request) otherList = [p.name for p in Project.objects.all()] return render_to_response( "rundb/data/modal_project_details.html", { # Other things here. "project_json": pr.serialize(None, pr.full_dehydrate(pr_bundle), 'application/json'), "project": project, "id": pk, 'otherList': json.dumps(otherList), "method": "PATCH", 'methodDescription': 'Edit', "readonly": True, 'action': reverse('api_dispatch_detail', kwargs={ 'resource_name': 'project', 'api_name': 'v1', 'pk': int(pk) }) })
def project_edit(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) pr_bundle = pr.build_bundle(obj=project, request=request) otherList = [p.name for p in Project.objects.all()] return render_to_response("rundb/data/modal_project_details.html", { # Other things here. "project_json": pr.serialize(None, pr.full_dehydrate(pr_bundle), 'application/json'), "project": project, "id": pk, 'otherList': json.dumps(otherList), "method": "PATCH", 'methodDescription': 'Edit', "readonly": True, 'action': reverse('api_dispatch_detail', kwargs={'resource_name': 'project', 'api_name': 'v1', 'pk': int(pk)}) })
def project_view(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) pr_bundle = pr.build_bundle(obj=project, request=request) return render_to_response("rundb/data/modal_project_details.html", { # Other things here. "project_json": pr.serialize(None, pr.full_dehydrate(pr_bundle), 'application/json'), "project": project, "method": "GET", "readonly": True, 'action': reverse('api_dispatch_detail', kwargs={'resource_name': 'project', 'api_name': 'v1', 'pk': int(pk)}, args={'format': 'json'}) })
def project_view(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) pr_bundle = pr.build_bundle(obj=project, request=request) return render_to_response( "rundb/data/modal_project_details.html", { # Other things here. "project_json": pr.serialize(None, pr.full_dehydrate(pr_bundle), "application/json"), "project": project, "method": "GET", "readonly": True, "action": reverse( "api_dispatch_detail", kwargs={"resource_name": "project", "api_name": "v1", "pk": int(pk)}, args={"format": "json"}, ), }, )