summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controller.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/controller.py b/controller.py
index 21684ee..1ac5132 100644
--- a/controller.py
+++ b/controller.py
@@ -141,7 +141,12 @@ class Const:
d = datetime.date.today()
current = ConstExpense.of_month(d.month, d.year)
- old = ConstExpense.query.except_(current).order_by(ConstExpense.start)
+
+ csub = current.subquery()
+
+ # if only mysql would allow "EXCEPT" -.-
+ old = ConstExpense.query.outerjoin((csub, csub.c.id == ConstExpense.id)).filter(csub.c.id == None)
+ old = old.order_by(ConstExpense.start)
return render("constlist", current = current.order_by(ConstExpense.start).all(), old = old.all())