Пример #1
0
    def __init__(self,
                 rf_py_web: RFPyWeb,
                 path_requests: str = TEST_ROUTE,
                 path_request_read: str = DEFAULT_PATH_REQUEST_READ,
                 path_request_edit: str = DEFAULT_PATH_REQUEST_EDIT,
                 path_request_delete: str = DEFAULT_PATH_REQUEST_DELETE,
                 path_request_add: str = DEFAULT_PATH_REQUEST_ADD,
                 path_request_list: str = DEFAULT_PATH_REQUEST_LIST,
                 path_request_count: str = DEFAULT_PATH_REQUEST_COUNT,
                 path_request_load_new: str = DEFAULT_PATH_REQUEST_LOAD_NEW,
                 secure: bool = True,
                 service_name: str = None):
        # Call super constructor
        RFBaseRoute.__init__(self, rf_py_web, path_requests=path_requests)
        self.path_request_read = path_request_read
        self.path_request_edit = path_request_edit
        self.path_request_delete = path_request_delete
        self.path_request_add = path_request_add
        self.path_request_list = path_request_list
        self.path_request_count = path_request_count
        self.path_request_load_new = path_request_load_new
        self.secure = secure
        self.service = None

        if RFUtilsStr.is_not_emtpy(service_name):
            self.service = RFContext.get_service(service_name)
Пример #2
0
 def get_service(self, key):
     """
     Method for get service
     :param key: for get service
     :return: service if found by key else return None
     """
     return RFContext.get_service(key)