summaryrefslogtreecommitdiff
path: root/controller.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-02-15 04:12:02 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-02-15 04:12:02 +0100
commit428283a2a067f8d0b3a0f7df7190df293b44e3de (patch)
treee629a0188618a71628831108946e6ac1517ce20c /controller.py
parent01444a8e45b7bd5b846ebc1a26afb87ee18f8265 (diff)
downloadkosten-428283a2a067f8d0b3a0f7df7190df293b44e3de.tar.gz
kosten-428283a2a067f8d0b3a0f7df7190df293b44e3de.tar.bz2
kosten-428283a2a067f8d0b3a0f7df7190df293b44e3de.zip
mysql fix
Diffstat (limited to 'controller.py')
-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())