[billreminder] Added new get_categories function. Now get_bills and get_categories accept a keyworded, variable-len
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] Added new get_categories function. Now get_bills and get_categories accept a keyworded, variable-len
- Date: Thu, 1 Oct 2009 17:40:08 +0000 (UTC)
commit 98974d61e47a099345a1f5509060f4a1df6614e1
Author: Og B. Maciel <ogmaciel gnome org>
Date: Thu Oct 1 13:39:55 2009 -0400
Added new get_categories function. Now get_bills and get_categories accept a keyworded, variable-length argument list.
src/lib/actions.py | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/actions.py b/src/lib/actions.py
index e88e5af..0d9f952 100644
--- a/src/lib/actions.py
+++ b/src/lib/actions.py
@@ -92,7 +92,7 @@ class Actions(object):
return records
- def get_bills(self, kwargs):
+ def get_bills(self, **kwargs):
"""
Returns a list of all bills filtered by values.
"""
@@ -107,3 +107,19 @@ class Actions(object):
session.close()
return records
+
+ def get_categories(self, **kwargs):
+ """
+ Returns a list of all categories filtered by values.
+ """
+ records = []
+
+ try:
+ session = self.dal.Session()
+ records = session.query(Category).filter_by(**kwargs).all()
+ except Exception, e:
+ print str(e)
+ finally:
+ session.close()
+
+ return records
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]