Skip to content

Instantly share code, notes, and snippets.

View dittos's full-sized avatar
😎

Taeho Kim dittos

😎
View GitHub Profile
@dittos
dittos / replace.py
Created December 4, 2012 11:08 — forked from jjangdm/replace.py
please
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)