Hello In my view I have:
a = Person.objects.select_related().get(pk=pk) b = a.issue_set.filter(resolution_date__isnull=True).aggregate(Sum('type__severity')) variables = RequestContext(request, { 'person': a, 'issue': b, }) return render_to_response('contacts/view_person.html', variables) b produces the query: SELECT SUM("issues_type"."severity") AS "type__severity__sum" FROM "issues_issue" LEFT OUTER JOIN "issues_type" ON ("issues_issue"."type_id" = "issues_type"."id") WHERE ("issues_issue"."person_id" = 1 AND "issues_issue"."resolution_date" IS NULL) How can I access and use type__severity__sum in my template please ? This is what I have tried: <div id="issuepanel"> {% for is in person.issue_set.all %} <h3>Issues</h3> {{ is.type__severity__sum }} {% endfor %} </div> Thanks for any help -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.