def get(self, request, params={}): service = StudentService() c = service.get(params["id"]) res = {} if (c != None): res["data"] = c.to_json() res["error"] = False res["message"] = "Data is found" else: res["error"] = True res["message"] = "record not found" return JsonResponse({"data": res["data"]})
def delete(self, request, params={}): service = StudentService() c = service.get(params["id"]) res = {} if (c != None): service.delete(params["id"]) res["data"] = c.to_json() res["error"] = False res["message"] = "Data is Successfully deleted" else: res["error"] = True res["message"] = "Data is not deleted" return JsonResponse({"data": res["data"]})