[billreminder] First cut at handling new relationship between Bill and Category
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] First cut at handling new relationship between Bill and Category
- Date: Thu, 26 Nov 2009 23:24:38 +0000 (UTC)
commit 060b9cf9dc7883704ee972063944cb45178401bc
Author: Og B. Maciel <ogmaciel gnome org>
Date: Thu Nov 26 18:23:40 2009 -0500
First cut at handling new relationship between Bill and Category
src/lib/dal.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/lib/dal.py b/src/lib/dal.py
index 9d90e19..eb46da3 100644
--- a/src/lib/dal.py
+++ b/src/lib/dal.py
@@ -45,10 +45,9 @@ class DAL(object):
bill.notes = dbobject.notes
bill.paid = dbobject.paid
if dbobject.category:
- bill.category = []
try:
- category = session.query(Category).filter_by(name=dbobject.category[0].name).one()
- bill.category.append(category)
+ category = session.query(Category).filter_by(name=dbobject.category.name).one()
+ bill.category = category
except Exception, e:
print "Failed to retrieve category \"%s\" for bill \"%s\": %s" \
% (dbobject.name, dbobject.category[0].name, str(e))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]