Esempio n. 1
0
 def get_object(self, request: HttpRequest):
     params = []
     params: ParamsObject = self.convert_params(request, HttpMethodType.get,
                                                params)
     hierarchy_service: hierarchyService = hierarchyService()
     data = hierarchy_service.get_object(params)
     return self.send_response(data)
Esempio n. 2
0
 def get(self, request: HttpRequest):
     params = [{
         "id":
         RequestConfig(from_session=False,
                       nullable=False,
                       datatype=DataTypes.INT)
     }]
     params: ParamsObject = self.convert_params(request, HttpMethodType.get,
                                                params)
     hierarchy_service: hierarchyService = hierarchyService()
     data = hierarchy_service.get(params)
     return self.send_response(data)
Esempio n. 3
0
    def delete(self, request: HttpRequest):
        hierarchy_json = json.loads(request.POST.get("hierarchy_json"))

        hierarchy_object: hierarchyModel = hierarchyModel()
        hierarchy_object.left_node = hierarchy_json.get("left_node")
        hierarchy_object.right_node = hierarchy_json.get("right_node")
        hierarchy_object.type = hierarchy_json.get("type")
        hierarchy_object.user_or_entity_id = hierarchy_json.get(
            "user_or_entity_id")
        hierarchy_object._id = hierarchy_json.get("_id")

        hierarchy_service: hierarchyService = hierarchyService()
        hierarchy_object = hierarchy_service.delete(hierarchy_object)

        return self.send_response(hierarchy_object)