Skip to content

Instantly share code, notes, and snippets.

@jjangdm
Created December 4, 2012 09:55
Show Gist options
  • Save jjangdm/4202295 to your computer and use it in GitHub Desktop.
Save jjangdm/4202295 to your computer and use it in GitHub Desktop.
please
def report(request):
today = datetime.datetime.now()
executor = Executor.objects.all()
budget_out1 = sum(Budget.objects.filter(year=today.year).values_list("out1", flat=True))
budget_out2 = sum(Budget.objects.filter(year=today.year).values_list("out2", flat=True))
budget_out3 = sum(Budget.objects.filter(year=today.year).values_list("out3", flat=True))
budget_out4 = sum(Budget.objects.filter(year=today.year).values_list("out4", flat=True))
budget_out5 = sum(Budget.objects.filter(year=today.year).values_list("out5", flat=True))
budget_out6 = sum(Budget.objects.filter(year=today.year).values_list("out6", flat=True))
budget_out7 = sum(Budget.objects.filter(year=today.year).values_list("out7", flat=True))
budget_out8 = sum(Budget.objects.filter(year=today.year).values_list("out8", flat=True))
budget_out9 = sum(Budget.objects.filter(year=today.year).values_list("out9", flat=True))
budget_out10 = sum(Budget.objects.filter(year=today.year).values_list("out10", flat=True))
budget_out11 = sum(Budget.objects.filter(year=today.year).values_list("out11", flat=True))
budget_out12 = sum(Budget.objects.filter(year=today.year).values_list("out12", flat=True))
budget_out13 = sum(Budget.objects.filter(year=today.year).values_list("out13", flat=True))
budget_out14 = sum(Budget.objects.filter(year=today.year).values_list("out14", flat=True))
budget_out15 = sum(Budget.objects.filter(year=today.year).values_list("out15", flat=True))
budget_out16 = sum(Budget.objects.filter(year=today.year).values_list("out16", flat=True))
budget_out17 = sum(Budget.objects.filter(year=today.year).values_list("out17", flat=True))
budget_out18 = sum(Budget.objects.filter(year=today.year).values_list("out18", flat=True))
budget_out19 = sum(Budget.objects.filter(year=today.year).values_list("out19", flat=True))
budget_out20 = sum(Budget.objects.filter(year=today.year).values_list("out20", flat=True))
budget_out21 = sum(Budget.objects.filter(year=today.year).values_list("out21", flat=True))
budget_out22 = sum(Budget.objects.filter(year=today.year).values_list("out22", flat=True))
budget_out23 = sum(Budget.objects.filter(year=today.year).values_list("out23", flat=True))
budget_out24 = sum(Budget.objects.filter(year=today.year).values_list("out24", flat=True))
budget_out25 = sum(Budget.objects.filter(year=today.year).values_list("out25", flat=True))
sum_of_management_budget = budget_out1 + budget_out2 + budget_out3 + budget_out4
sum_of_education_budget = budget_out5 + budget_out6 + budget_out7
sum_of_feed_budget = budget_out8 + budget_out9 + budget_out10 + budget_out11+ budget_out12 + budget_out13
sum_of_reward_budget = budget_out14 + budget_out15 + budget_out16
sum_of_mission_budget = budget_out17 + budget_out18 + budget_out19 + budget_out20 + budget_out21
sum_of_operation_budget = budget_out22 + budget_out23 + budget_out24 + budget_out25
budget_total = sum_of_management_budget + sum_of_education_budget + sum_of_feed_budget + sum_of_reward_budget + sum_of_mission_budget + sum_of_operation_budget
...
...
...
...
return render_to_response('report.html',
{
'budget_out1': budget_out1,
'budget_out2': budget_out2,
'budget_out3': budget_out3,
'budget_out4': budget_out4,
'budget_out5': budget_out5,
'budget_out6': budget_out6,
'budget_out7': budget_out7,
'budget_out8': budget_out8,
'budget_out9': budget_out9,
'budget_out10': budget_out10,
'budget_out11': budget_out11,
'budget_out12': budget_out12,
'budget_out13': budget_out13,
'budget_out14': budget_out14,
'budget_out15': budget_out15,
'budget_out16': budget_out16,
'budget_out17': budget_out17,
'budget_out18': budget_out18,
'budget_out19': budget_out19,
'budget_out20': budget_out20,
'budget_out21': budget_out21,
'budget_out22': budget_out22,
'budget_out23': budget_out23,
'budget_out24': budget_out24,
'budget_out25': budget_out25,
'budget_total': budget_total,
'sum_of_management_budget' : sum_of_management_budget,
'sum_of_education_budget' : sum_of_education_budget,
'sum_of_feed_budget' : sum_of_feed_budget,
'sum_of_reward_budget' : sum_of_reward_budget,
'sum_of_mission_budget' : sum_of_mission_budget,
'sum_of_operation_budget' : sum_of_operation_budget,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment