Switch to UV

This commit is contained in:
Peter Stockings
2026-02-27 12:36:40 +11:00
parent b0b42c0d77
commit a401c1a1ab
5 changed files with 752 additions and 3 deletions

5
db.py
View File

@@ -47,6 +47,7 @@ class DataBase():
def close_connection(self, exception=None):
db = g.pop('database', None)
if db is not None:
db.rollback()
self._pool.putconn(db)
def execute(self, query, args=(), one=False, commit=False):
@@ -429,8 +430,8 @@ class DataBase():
WHERE
W.person_id = %s
AND E.exercise_id = %s AND
(%s IS NULL OR W.start_date >= %s) AND
(%s IS NULL OR W.start_date <= %s)
(%s::date IS NULL OR W.start_date >= %s::date) AND
(%s::date IS NULL OR W.start_date <= %s::date)
ORDER BY
W.start_date;
""", [person_id, exercise_id, min_date, min_date, max_date, max_date])