On Mon, Mar 7, 2011 at 5:44 PM, sushanth Reddy <sushant...@gmail.com> wrote:
> Hi ,
>
> I want to make total at the end of the each row,i have explained the details
> in below
> link.
>
> http://stackoverflow.com/questions/5223093/how-to-aggreate-in-html-django
>
> Can you please help me
>
> Thanks in advance
>
> sushanth
>

Er. You're iterating through a list of values, and outputting them,
and at the end of that list, you want to output the sum of the values
you've just output.

How hard have you thought about this?!

Did you consider having some sort of counter variable, and each time
you output a value, you increment the counter by that value..

BTW, looking at the code on stack overflow, it looks like you are
doing one sql query per cell in your output table. This is extremely
inefficient.
At most, this sort of task should only require 1 query to get the list
of users, and 1 query per user to get the list of all expenses for the
selected period.

Cheers

Tom

-- 
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.

Reply via email to