From 922bf769f99ab6755c04dc62caab5f91353d4d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Sureau?= Date: Wed, 10 Aug 2011 12:59:30 +0200 Subject: It is now possible to edit existing bills. --- budget/utils.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'budget/utils.py') diff --git a/budget/utils.py b/budget/utils.py index ed283cf..c4b1e75 100644 --- a/budget/utils.py +++ b/budget/utils.py @@ -6,14 +6,9 @@ from forms import BillForm def get_billform_for(project): """Return an instance of BillForm configured for a particular project.""" - payers = [] - ids = [] - for m in project.active_members: - payers.append( (str(m.id), m.name) ) - ids.append( str(m.id) ) form = BillForm() - form.payed_for.choices = form.payer.choices = payers - form.payed_for.data = ids + form.payed_for.choices = form.payer.choices = [(str(m.id), m.name) for m in project.active_members] + form.payed_for.default = [ str(m.id) for m in project.active_members] return form def requires_auth(f): -- cgit v1.1