[billreminder] Return bills ordered by due date in descending order.



commit 9c66fc5901f26fbc791824f1c49554a9644574c8
Author: Og B. Maciel <ogmaciel gnome org>
Date:   Sat Nov 28 22:24:24 2009 -0500

    Return bills ordered by due date in descending order.

 src/lib/actions.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/lib/actions.py b/src/lib/actions.py
index 091d8a9..0362184 100644
--- a/src/lib/actions.py
+++ b/src/lib/actions.py
@@ -35,7 +35,7 @@ class Actions(object):
             q = session.query(Bill).options(eagerload('category')).filter(Bill.dueDate >= start).filter(Bill.dueDate <= end)
             if paid != None:
                 q = q.filter(Bill.paid == paid)
-            records = q.all()
+            records = q.order_by(Bill.dueDate.desc()).all()
         except Exception, e:
             print str(e)
             pass
@@ -83,7 +83,7 @@ class Actions(object):
             q = session.query(Bill).filter(Bill.dueDate >= firstDay).filter(Bill.dueDate <= lastDay)
             if paid:
                 q = q.filter(Bill.paid == paid)
-            records = q.all()
+            records = q.order_by(Bill.dueDate.desc()).all()
         except Exception, e:
             print str(e)
         finally:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]