summaryrefslogtreecommitdiff
path: root/src/database/dbsearch.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/dbsearch.py')
-rw-r--r--src/database/dbsearch.py18
1 files changed, 12 insertions, 6 deletions
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 = """