Exemple #1
0
 def get_list(self, request: HttpRequest):
     params = [
         {"ids": RequestConfig(from_session=False, nullable=False, datatype=DataTypes.STRING, default='')}
     ]
     params: ParamsObject = self.convert_params(request, HttpMethodType.get, params)
     category_service: CategoryService = CategoryService()
     data = category_service.get_list(params)
     return self.send_response(data)
Exemple #2
0
    def delete(self, request: HttpRequest):
        category_json = json.loads(request.POST.get("category_json"))

        category_object: CategoryModel = CategoryModel()
        category_object.categoryid = category_json.get("categoryid")
        category_object.name = category_json.get("name")
        category_object.description = category_json.get("description")
        category_object.imageurl = category_json.get("imageurl")

        category_service: CategoryService = CategoryService()
        category_object = category_service.delete(category_object)

        return self.send_response(category_object)
Exemple #3
0
 def get_list_object_page(self, request: HttpRequest):
     params = []
     params: ParamsObject = self.convert_params(request, HttpMethodType.get, params)
     category_service: CategoryService = CategoryService()
     data = category_service.get_list_object_paginated(params)
     return self.send_response(data)