From 87276d27627cc804880f52f6fd36eab040d6b760 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Wed, 17 Jun 2015 00:45:22 +0200 Subject: [PATCH] Fix scheduled operations query. --- accountant/api/models/scheduled_operations.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/accountant/api/models/scheduled_operations.py b/accountant/api/models/scheduled_operations.py index f8a2a51..6109e16 100644 --- a/accountant/api/models/scheduled_operations.py +++ b/accountant/api/models/scheduled_operations.py @@ -56,14 +56,12 @@ class ScheduledOperation(db.Model): query = session.query( cls - ).select_from( - session.query(cls) - .filter(cls.account_id == account_id) - .order_by( - desc(cls.day), - cls.value, - cls.label, - ).subquery() + ).filter( + cls.account_id == account_id + ).order_by( + desc(cls.day), + cls.value, + cls.label, ) return query