Fix: list_abs_date

This commit is contained in:
Emmanuel Viennet 2022-04-28 01:13:48 +02:00
parent e90f3077f8
commit 7866743eb8

View File

@ -423,17 +423,19 @@ def list_abs_date(etudid, beg_date=None, end_date=None):
print("On rentre") print("On rentre")
cnx = ndb.GetDBConnexion() cnx = ndb.GetDBConnexion()
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor) cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
print("Juste avant le SQL")
cursor.execute( req = """SELECT jour, matin, estabs, estjust, description
"""SELECT jour, matin, estabs, estjust, description FROM ABSENCES A FROM ABSENCES A
WHERE A.ETUDID = %(etudid)s""" WHERE A.ETUDID = %(etudid)s""" + (
+ "" ""
if beg_date is None if beg_date is None
else """ else """
AND A.jour >= %(beg_date)s AND A.jour >= %(beg_date)s
AND A.jour <= %(end_date)s AND A.jour <= %(end_date)s
""", """
)
cursor.execute(
req,
vars(), vars(),
) )