Fix on group_by dict based reimplemenattion
This commit is contained in:
parent
5fa54adf24
commit
22f47d4fcd
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue