Skip to content Skip to sidebar Skip to footer

Using Django To Summarize Report

I'm trying to produce a table that will show the total maturity amounts for each financial institution that a plan has. A plan is the term I use for person. So each person can hav

Solution 1:

So, you want to aggregate the values of the investments for a plan:

from django.db.models import Sum
my_plan.investment_set.filter(
    maturity_date__gte=whenever
).values('financial_institution').annotate(Sum('value'))

Post a Comment for "Using Django To Summarize Report"