def search(self, request, params={}): service = CourseService() c = service.search() res = {} data = [] for x in c: data.append(x.to_json()) if (c != None): res["data"] = data res["error"] = False res["message"] = "Data is found" else: res["error"] = True res["message"] = "record not found" return JsonResponse({"data": res})
def search(self, request, params={}): json_request = json.loads(request.body) if (json_request): params["courseName"] = json_request.get("courseName", None) params["pageNo"] = json_request.get("pageNo", None) service = CourseService() c = service.search(params) res = {} if (c != None): res["data"] = c["data"] res["error"] = False res["message"] = "Data is found" else: res["error"] = True res["message"] = "record not found" return JsonResponse({"result": res})
def search(self,request, params = {}): json_request=json.loads(request.body) if(json_request): params["courseName"]=json_request.get("courseName",None) service=CourseService() c=service.search(params) res={} data=[] for x in c: data.append(x.to_json()) if(c!=None): res["data"]=data res["error"]=False res["message"]="Data is found" else: res["error"]=True res["message"]="record not found" return JsonResponse({"data":res})