def project_delete(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) _type = 'project' ctx = template.RequestContext( request, { "id": pk, "name": project.name, "method": "DELETE", 'methodDescription': 'Delete', "readonly": False, 'type': _type, 'action': reverse('api_dispatch_detail', kwargs={ 'resource_name': _type, 'api_name': 'v1', 'pk': int(pk) }) }) return render_to_response("rundb/data/modal_confirm_delete.html", context_instance=ctx)
def project_delete(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) _type = 'project' ctx = template.RequestContext(request, { "id": pk, "name": project.name, "method": "DELETE", 'methodDescription': 'Delete', "readonly": False, 'type': _type, 'action': reverse('api_dispatch_detail', kwargs={'resource_name': _type, 'api_name': 'v1', 'pk': int(pk)}) }) return render_to_response("rundb/data/modal_confirm_delete.html", context_instance=ctx)
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_delete(request, pk=None): pr = ProjectResource() project = pr.obj_get(pk=pk) _type = "project" ctx = template.RequestContext( request, { "id": pk, "name": project.name, "method": "DELETE", "methodDescription": "Delete", "readonly": False, "type": _type, "action": reverse("api_dispatch_detail", kwargs={"resource_name": _type, "api_name": "v1", "pk": int(pk)}), }, ) return render_to_response("rundb/data/modal_confirm_delete.html", context_instance=ctx)
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_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'}) })