Fix order_by in over.

This commit is contained in:
Alexis Lahouze 2015-06-06 22:00:09 +02:00
parent 9742344361
commit e1b5d8be43

View File

@ -38,7 +38,7 @@ def get_entries(account_id, year, month):
whens={Operation.canceled: None},
else_=func.sum(Operation.value).over(
partition_by="canceled",
order_by="operation_date, value desc, label desc")
order_by=["operation_date", desc("value"), desc("label")])
).label("sold")
).filter(Operation.account_id == account_id).order_by(
desc(Operation.operation_date),