-
-
Save jjangdm/4205010 to your computer and use it in GitHub Desktop.
please
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def report(request): | |
today = datetime.datetime.now() | |
executor = Executor.objects.all() | |
queryset = Budget.objects.filter(year=today.year) | |
aggregates = {} | |
for i in xrange(1, 25+1): | |
aggregates['out%d' % i] = models.Sum('out%d' % i) | |
budget = queryset.aggregate(**aggregates) | |
budget['sum_of_management_budget'] = budget['out1'] + budget['out2'] + budget['out3'] + budget['out4'] | |
... | |
return render_to_response('report.html', budget) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment