def __init__(self,orm = True): self._connection = PostgreSQL_backend.connect_to_db() if orm: self._orm_session = PostgreSQL_backend.connect_to_db_orm() else: self._orm_session = None self._present_table_type = '' self._cursor = self.connection.cursor()
def search_item(self, item, pr_key_mode, not_default_table=None): if pr_key_mode: return PostgreSQL_backend.select_item(self.cursor, self.present_table_type, item, pr_key_mode) else: return PostgreSQL_backend.select_item(self.cursor, not_default_table, item, pr_key_mode)
def text_search_full_phrase(self, phrase, pr_key, attribute): return PostgreSQL_backend.text_search_full_phrase( self.cursor, phrase, pr_key, attribute, self.present_table_type)
def static_search_film_session(self, cortage): return PostgreSQL_backend.static_search_film_session( self.cursor, cortage)
def disconnect_from_db(self): PostgreSQL_backend.disconnect_from_db(self.connection, self.cursor)
def delete_all(self): return PostgreSQL_backend.delete_all(self.cursor, self.present_table_type)
def __init__(self): self._connection = PostgreSQL_backend.connect_to_db() self._present_table_type = '' self._cursor = self.connection.cursor()
def read_items(self): if self.orm_session: return PostgreSQL_backend.select_all_orm(self.orm_session,self.present_table_type) else: return PostgreSQL_backend.select_all(self.cursor,self.present_table_type)
def update_item(self, list): PostgreSQL_backend.update_item(self.cursor, self.present_table_type, list)
def read_items(self): return PostgreSQL_backend.select_all(self.cursor, self.present_table_type)
def create_item(self, cortage): PostgreSQL_backend.insert_one(self.cursor, self.present_table_type, cortage)
def delete_all(self): if self.orm_session: return PostgreSQL_backend.delete_all_orm(self.orm_session,self.present_table_type) return PostgreSQL_backend.delete_all(self.cursor,self.present_table_type)
def delete_item(self,pr_key): if self.orm_session: return PostgreSQL_backend.delete_one_orm(self.orm_session,self.present_table_type,pr_key) else: return PostgreSQL_backend.delete_one(self.cursor,self.present_table_type,pr_key)
def update_item(self, list): if self.orm_session: return PostgreSQL_backend.update_item_orm(self.orm_session,self.present_table_type,list) else: return PostgreSQL_backend.update_item(self.cursor, self.present_table_type, list)
def text_search_without_word(self, phrase, pr_key, attribute): return PostgreSQL_backend.text_search_without_definite_words( self.cursor, phrase, pr_key, attribute, self.present_table_type)
def delete_item(self, pr_key): return PostgreSQL_backend.delete_one(self.cursor, self.present_table_type, pr_key)
def dynamic_search(self, array_with_selected_attributes, cortege_with_attributes, cortege_with_table_names): return PostgreSQL_backend.dynamic_search( self.cursor, array_with_selected_attributes, cortege_with_attributes, cortege_with_table_names)
def create_item(self,cortage): if self.orm_session: PostgreSQL_backend.insert_one_orm(self.orm_session,self.present_table_type,cortage) else: PostgreSQL_backend.insert_one(self.cursor,self.present_table_type,cortage)