http://nooooooooooooooo.com/ :)

Don't iterate through each extra cost - try to use sum on db side, ex:
```
extra_costs = DailyExtraCost.objects.filter(
    date__gte=start,
    date__lte=end,
    pricing_venture__in=ventures,
).values('pricing_venture', 'type').annotate(total_cost=Sum('value')) 
```
Using this you'll have sth similar to what you get after your for loop - you'll just have to iterate through this list and add it to your dict in desired format and sum total_cost, ex:
```
for ec in extra_costs:
    usages[ec['pricing_venture']][ec['type']] = ec['value']
    usages[ec['pricing_venture']['extra_costs_total_cost'] += ec['value']
```