Created
February 24, 2013 14:50
-
-
Save jjangdm/5024100 to your computer and use it in GitHub Desktop.
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
import datetime | |
today = datetime.datetime.now() | |
income_list = [] | |
outcome_list = [] | |
item_number_list = Item.objects.all().values_list("item_number", flat=True) | |
for month in range(1,13): | |
for n in item_number_list: | |
temp = sum(Income.objects.filter(date__year=today.year, date__month="%s" %n).values_list("money",flat=True)) | |
income_list.append(temp) | |
for month in range(1,13): | |
for n in item_number_list: | |
temp = sum((Outcome.objects.filter(date__year=today.year, date__month="%s" %n).values_list("money",flat=True)) | |
outcome_list.append(temp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment