Fixed month order.
This commit is contained in:
parent
39db433854
commit
a290c07f61
@ -54,8 +54,8 @@ def get_months(account_id):
|
|||||||
session = db.session
|
session = db.session
|
||||||
|
|
||||||
query = session.query(
|
query = session.query(
|
||||||
distinct(cast(extract("year", Entry.operation_date), db.String)).label("year"),
|
distinct(func.lpad(cast(extract("year", Entry.operation_date), db.String), 4, '0')).label("year"),
|
||||||
cast(extract("month", Entry.operation_date), db.String).label("month")
|
func.lpad(cast(extract("month", Entry.operation_date), db.String), 2, '0').label("month")
|
||||||
).filter(Entry.account_id == account_id).order_by("year", "month")
|
).filter(Entry.account_id == account_id).order_by("year", "month")
|
||||||
|
|
||||||
return json.dumps([{
|
return json.dumps([{
|
||||||
|
Loading…
Reference in New Issue
Block a user