aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
authorFrédéric Sureau <fred@milka.(none)>2011-08-09 18:05:55 +0200
committerFrédéric Sureau <fred@milka.(none)>2011-08-09 18:05:55 +0200
commit3c5ac5b78286a1670043aba06f2b7164f44d36c2 (patch)
treee42cb2cbef386727cfb9562d8269ea587339fc66 /budget
parentefb9d8942cf9d0c4e965f351518c7c28101aa9fa (diff)
downloadihatemoney-mirror-3c5ac5b78286a1670043aba06f2b7164f44d36c2.zip
ihatemoney-mirror-3c5ac5b78286a1670043aba06f2b7164f44d36c2.tar.gz
ihatemoney-mirror-3c5ac5b78286a1670043aba06f2b7164f44d36c2.tar.bz2
The bills list now only displays the specific bills of the project.
Diffstat (limited to 'budget')
-rw-r--r--budget/web.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/budget/web.py b/budget/web.py
index c2909bc..a838b09 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -106,8 +106,11 @@ def invite(project):
@app.route("/<string:project_id>/")
@requires_auth
def list_bills(project):
- # FIXME filter to only get the bills for this particular project
- bills = Bill.query.order_by(Bill.id.asc())
+ bills = Bill.query.join(Person, Project)\
+ .filter(Bill.payer_id == Person.id)\
+ .filter(Person.project_id == Project.id)\
+ .filter(Project.id == project.id)\
+ .order_by(Bill.date.desc())
return render_template("list_bills.html",
bills=bills, project=project,
member_form=MemberForm(project),