Skip to content

Instantly share code, notes, and snippets.

@blackmann
Created November 12, 2020 21:55
Show Gist options
  • Save blackmann/15f128e6021d3835767211590377e7cd to your computer and use it in GitHub Desktop.
Save blackmann/15f128e6021d3835767211590377e7cd to your computer and use it in GitHub Desktop.
Hahahahaha
data.append({
'title': 'Revenue',
'value': models.Order.objects.filter(valid=True).annotate(total=ExpressionWrapper((F('vehicle_rate__rate') + F('driver_rate__rate')) * F('days'), DecimalField())).values('total').aggregate(Sum('total'))['total__sum'],
'prefix': 'GHS'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment