Total usage can be calculated on db site - running it on python site is slooow. Please change it to sth like this
```
total_usage_query = DailyUsage.objects.filter(
    date__gte=usage_price.start,
    date__lte=usage_price.end,
    type=usage_type.id
)
if warehouse:
    total_usage_query = total_usage_query.filter(warehouse=warehouse)
total_usage = total_usage_query.aggregate(total=Sum('value')).get('total_usage', 0)
```