[billreminder] fixed the filtering so it works also with zero (not paid only)
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] fixed the filtering so it works also with zero (not paid only)
- Date: Sat, 28 Nov 2009 14:27:30 +0000 (UTC)
commit e3c1c98b927d1baf130e443f44cbe3521f5bf32f
Author: Toms Bauģis <toms baugis gmail com>
Date: Sat Nov 28 11:01:52 2009 +0000
fixed the filtering so it works also with zero (not paid only)
src/lib/actions.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/lib/actions.py b/src/lib/actions.py
index 2abfcee..091d8a9 100644
--- a/src/lib/actions.py
+++ b/src/lib/actions.py
@@ -22,18 +22,18 @@ class Actions(object):
self.dal = databaselayer
- def get_interval_bills(self, start, end, paid=None):
+ def get_interval_bills(self, start, end, paid = None):
"""
"""
records = []
- paid = bool(paid) if (paid and paid < 2) else None
+ paid = bool(paid) if paid in (0,1) else None
try:
session = self.dal.Session()
q = session.query(Bill).options(eagerload('category')).filter(Bill.dueDate >= start).filter(Bill.dueDate <= end)
- if paid:
+ if paid != None:
q = q.filter(Bill.paid == paid)
records = q.all()
except Exception, e:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]