Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- costs = AdditionalCost.objects.filter(side__layer__campaign_location__in=OuterRef('locations')
- ).annotate(budget=Sum('cost_value'))
- return Campaign.objects.filter(name='zaga3')\
- .annotate(january_budget=Cast(Subquery(costs), output_field=DecimalField(max_digits=12, decimal_places=2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement