[billreminder] Query bills with eagerload to fetch categories.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] Query bills with eagerload to fetch categories.
- Date: Sat, 3 Oct 2009 02:33:26 +0000 (UTC)
commit 1dbb6232338f21cd670ef39f997e1a85a0ef96c9
Author: Og B. Maciel <ogmaciel gnome org>
Date: Fri Oct 2 22:22:09 2009 -0400
Query bills with eagerload to fetch categories.
src/lib/actions.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/lib/actions.py b/src/lib/actions.py
index c91cf26..7821521 100644
--- a/src/lib/actions.py
+++ b/src/lib/actions.py
@@ -100,7 +100,7 @@ class Actions(object):
try:
session = self.dal.Session()
- records = session.query(Bill).filter_by(**kwargs).all()
+ records = session.query(Bill).options(eagerload('category')).filter_by(**kwargs).all()
except Exception, e:
print str(e)
finally:
@@ -126,4 +126,3 @@ class Actions(object):
def add_bill(self, bill):
return self.dal.add(bill)
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]