[billreminder: 3/10] Add method to count how many bills are not paid



commit 38568c2bc1a6b229a339360cf450b20339dd23e6
Author: Luiz Armesto <luiz armesto gmail com>
Date:   Thu Jun 16 20:56:05 2011 -0300

    Add method to count how many bills are not paid

 src/lib/actions.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/lib/actions.py b/src/lib/actions.py
index 9c5c33d..8bf3994 100644
--- a/src/lib/actions.py
+++ b/src/lib/actions.py
@@ -155,6 +155,20 @@ class Actions(object):
 
         return records
 
+    def count_not_paid(self):
+        count = 0
+
+        try:
+            session = self.dal.Session()
+            count = session.query(Bill).filter(Bill.paid == False).count()
+        except Exception, e:
+            print str(e)
+        finally:
+            session.close()
+
+        return count
+
+
     def add(self, dbobject):
         return self.dal.add(dbobject)
 



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