Beispiel #1
0
 def __get_data_direct(self,
                       sp_name,
                       params: ParamsObject,
                       is_cacheable=True,
                       cache_key_prefix="",
                       is_multiple_rs=False):
     data = None
     if params is None:
         params = []
     if is_multiple_rs:
         data = self.normal_repo.get_direct_multiple(
             sp_name, params.get_params_list())
     else:
         data = self.normal_repo.get_direct(sp_name,
                                            params.get_params_list())
     return data
Beispiel #2
0
 def __add_update_delete_direct(self,
                                sp_name,
                                params: ParamsObject,
                                flag="ADD"):
     data = None
     if flag == "ADD":
         data = self.normal_repo.add_direct(sp_name,
                                            params.get_params_list())
     elif flag == "UPDATE":
         data = self.normal_repo.update_direct(sp_name,
                                               params.get_params_list())
     elif flag == "DELETE":
         data = self.normal_repo.delete_direct(sp_name,
                                               params.get_params_list())
     else:
         pass
     return data
Beispiel #3
0
 def get_cache_key(self, object, params: ParamsObject):
     try:
         params_list = params.get_params_list()
         prefix = ""
         if object != "" and object is not None:
             prefix = object
         key = ''.join(str(e) if e is not None else "" for e in params_list)
         return prefix + ':' + key
     except Exception as ex:
         pass
Beispiel #4
0
 def __add_update_delete_direct_transactional(self,
                                              sp_name,
                                              params: ParamsObject,
                                              flag="ADD"):
     data = None
     self.begin_transaction()
     if flag == "ADD":
         data = self.transaction_repo.add_direct(sp_name,
                                                 params.get_params_list())
     elif flag == "UPDATE":
         data = self.transaction_repo.update_direct(
             sp_name, params.get_params_list())
     elif flag == "DELETE":
         data = self.transaction_repo.delete_direct(
             sp_name, params.get_params_list())
     else:
         pass
     self.commit()
     return data
 def get_data_list_object_any_paginated(self, sp_name, params: ParamsObject):
     """
     :description: This method allows user to get the data list object for any procedure which always                            returns the model object with pagination
     :param sp_name: Procedure name to call
     :param params: list of parameters
     :return: List of model object
     """
     if base.DEBUG_ENABLED:
         LoggingHelper().log_debug(self.__class__, "", params)
     try:
         self.get_cursor(db_type="R").callproc(sp_name, params.get_params_list())
         list_cursor_object = self.data_as_cursor_list_multiple_rs()
         return self.post_get_data_list_object_paginated(list_cursor_object)
     except Exception as ex:
         if base.DEBUG_ENABLED:
             LoggingHelper().log_error(self.__class__, "", str(ex))
         if isinstance(ex, DatabaseException) or isinstance(ex, KaroException):
             raise DatabaseException(self.db_error_code, ex.error_message, self.data)
         else:
             raise DatabaseException(self.db_error_code, str(ex), self.data)
     finally:
         self.close_cursor()
         if base.DEBUG_ENABLED:
             LoggingHelper().log_debug(self.__class__, "", self.data)
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sBSSubjectDtlObjectGetList"
     self.params_list = params.get_params_list()
 def get_products_by_search(self, params: ParamsObject):
     return self.get_direct_multiple("sGetProductBySearch",
                                     params.get_params_list())
 def get_products_by_subcategory(self, params: ParamsObject):
     return self.get_direct_multiple("sGetProductBySubCategory",
                                     params.get_params_list())
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sProductObjectGetList"
     self.params_list = params.get_params_list()
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sUniversityObjectGetList"
     self.params_list = params.get_params_list()
Beispiel #11
0
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sStudentAYObjectGetList"
     self.params_list = params.get_params_list()
 def customer_authentication(self, params: ParamsObject):
     # return params.get_params_list()
     return self.get_direct("sCustomerAuthenticate",
                            params.get_params_list())
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sCustomerAddressObjectGetList"
     self.params_list = params.get_params_list()
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sCollegeBranchObjectGetList"
     self.params_list = params.get_params_list()
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sSubCategoryObjectGetList"
     self.params_list = params.get_params_list()
Beispiel #16
0
 def pre_get_list_object(self, params: ParamsObject):
     self.sp_name = "sOrderItemObjectGetList"
     self.params_list = params.get_params_list()