Fix on group_by dict based reimplemenattion

This commit is contained in:
Marc 2014-09-16 14:42:32 +00:00
parent 5fa54adf24
commit 22f47d4fcd
2 changed files with 2 additions and 1 deletions

View file

@ -313,7 +313,7 @@ class OrderQuerySet(models.QuerySet):
commit = options.get('commit', True)
for account, services in qs.group_by('account', 'service').iteritems():
bill_lines = []
for service, orders in services:
for service, orders in services.iteritems():
lines = service.handler.generate_bill_lines(orders, account, **options)
bill_lines.extend(lines)
if commit:

View file

@ -21,6 +21,7 @@ def group_by(qset, *fields):
group = group[current]
except KeyError:
group[current] = OrderedDict()
group = group[current]
else:
try:
group[current].append(obj)