0

My database have one col namely MaxSubjectMarks

MaxSubjectMarks (Column name) 10 20 30 40 50

150 (I want 150 output)

q = SubjectsMaximumMarks.objects.filter(SessionCode=SessionResult,ClassCode=StudentClass).values('MaxSubjectMarks').annotate(total=Sum("MaxSubjectMarks"))

{{ q }}

output => <QuerySet [{'MaxSubjectMarks': '10', 'total': 10.0}, {'MaxSubjectMarks': '20', 'total': 20.0}, {'MaxSubjectMarks': '30', 'total': 30.0}, {'MaxSubjectMarks': '40', 'total': 40.0}, {'MaxSubjectMarks': '50', 'total': 50.0}]>

i want output

Total = 150

Bintu
  • 5
  • 1
  • 1
  • 4

0 Answers0