Remove duplicate
This commit is contained in:
parent
79840a57f2
commit
0d752f0c9b
1 changed files with 2 additions and 12 deletions
14
stock.py
14
stock.py
|
@ -115,11 +115,11 @@ class Stock(BaseDeDonnees):
|
||||||
return [dict(zip(recuperation, element)) for element in self.affichageResultat(self.requete(requete))]
|
return [dict(zip(recuperation, element)) for element in self.affichageResultat(self.requete(requete))]
|
||||||
|
|
||||||
def stockExistant(self, stock: str) -> bool:
|
def stockExistant(self, stock: str) -> bool:
|
||||||
"""Vérifie si l"stock donnée existe déjà dans la base de donnée."""
|
"""Vérifie si le stock donnée existe déjà dans la base de donnée."""
|
||||||
requete = """
|
requete = """
|
||||||
SELECT EXISTS (
|
SELECT EXISTS (
|
||||||
SELECT 1 FROM stocks
|
SELECT 1 FROM stocks
|
||||||
WHERE name = ?
|
WHERE nom = ?
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
return True if self.affichageResultat(self.requete(requete, stock.lower()))[0][0] == 1 else False
|
return True if self.affichageResultat(self.requete(requete, stock.lower()))[0][0] == 1 else False
|
||||||
|
@ -134,13 +134,3 @@ class Stock(BaseDeDonnees):
|
||||||
if i[0] not in res:
|
if i[0] not in res:
|
||||||
res.append(i[0])
|
res.append(i[0])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def elementStockExistant(self, element: str) -> bool:
|
|
||||||
"""Vérifie si l'élément donnée existe déjà dans la base de donnée."""
|
|
||||||
requete = """
|
|
||||||
SELECT EXISTS (
|
|
||||||
SELECT 1 FROM stocks
|
|
||||||
WHERE nom = ?
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
return True if self.affichageResultat(self.requete(requete, element.lower()))[0][0] == 1 else False
|
|
||||||
|
|
Reference in a new issue