From 809f5c2c7ce0bdf05287c6f1b5ec1330efb0c469 Mon Sep 17 00:00:00 2001 From: Debulois Date: Sun, 1 May 2022 23:24:19 +0200 Subject: Ajout du système pour mandater et mise en page des documents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/database/dbsearch.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/database/dbsearch.py') diff --git a/src/database/dbsearch.py b/src/database/dbsearch.py index 0561c9d..62316f4 100644 --- a/src/database/dbsearch.py +++ b/src/database/dbsearch.py @@ -9,11 +9,11 @@ # https:#www.freecodecamp.org/news/sql-joins-tutorial/ # Import de dbmain -from src.database import dbmain +from src.database.dbmain import DbMain # Extension de cette classe avec dbmain -class DbSearch(dbmain.DbMain): +class DbSearch(DbMain): # **************************************************************************** # RECUPERATION DES INFORMATIONS RELATIVES AUX UTILISATEURS # **************************************************************************** @@ -43,10 +43,11 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqGetUserInfo, [userId]) return self.cur.fetchall() + # **************************************************************************** # RECUPERATION DES INFORMATIONS RELATIVES AUX PROS # **************************************************************************** - def get_all_pro_by_jobid(self, jobId): + def get_all_pro_by_jobid(self, jobId: int) -> list: reqSearchConsultant = """ SELECT """ + self.TABLEUSERINFO + """.userId, @@ -62,8 +63,9 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqSearchConsultant, [jobId]) return self.cur.fetchall() + # Récupération des infos d'un pro par son nom - def get_pro_info_by_lastname(self, lastname): + def get_pro_info_by_lastname(self, lastname: str) -> list: reqSearchConsultant = """ SELECT """ + self.TABLEUSERINFO + """.userId, @@ -81,8 +83,9 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqSearchConsultant, [lastname]) return self.cur.fetchall() + # Récupération des emploies associés à un pro - def get_pro_job_by_proid(self, proId): + def get_pro_job_by_proid(self, proId: int) -> list: reqGetAll = """ SELECT """ + self.TABLEUSERJOB + """.jobCategoryId, @@ -98,8 +101,9 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqGetAll, [proId]) return self.cur.fetchall() + # Récupération des notes d'un consultant par son nom - def get_pro_note_by_proid(self, proId): + def get_pro_note_by_proid(self, proId: int) -> list: reqCountMission = """ SELECT note @@ -114,6 +118,7 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqCountMission, [proId]) return self.cur.fetchall() + # **************************************************************************** # RECUPERATION DES INFORMATIONS RELATIVES AUX EMPLOIS # **************************************************************************** @@ -127,6 +132,7 @@ class DbSearch(dbmain.DbMain): self.exec_cmd(reqGetAllJobs) return self.cur.fetchall() + # Récupérer toutes les infos de la table jobCategory def get_job_by_jobid(self, jobId: int) -> list: reqGetJobinfo = """ -- cgit v1.2.3