Commit f414c0ce authored by Marine Marsal's avatar Marine Marsal
Browse files

Update PretDataMapper.py ajout getExemplairePret et miseAJourExemplaire

parent db18ac63
......@@ -51,5 +51,28 @@ class PretDataMapper(DataMapper):
print(err)
finally:
connection.close()
def getExemplairesPret(self, pretID) :
connection = self.connect()
try:
cursor : psycopg2.extensions.cursor = connection.cursor()
cursor.execute("SELECT * FROM ExemplairePret ep WHERE ep.pret = {0}".format(pretID))
rows = cursor.fetchall()
return rows
except Exception as err:
print(err)
finally:
connection.close()
def miseAJourEtatExemplaire(self, ref, etat) :
connection = self.connect()
try:
cursor : psycopg2.extensions.cursor = connection.cursor()
cursor.execute("UPDATE Exemplaire SET etat = '{0}' WHERE ref = '{1}'".format(etat, ref))
connection.commit()
except Exception as err:
print(err)
finally:
connection.close()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment