In addition to the above, you can have a field in your model, that
will contain that sum, and update it in your save(). It may not be as
beneficial with sum() as it is with some other functions that work on
multiple rows.

陈亮 wrote:
> Hi there,
>     I've googled a lot on how to get the sum of a integer field for all the
> objects of a model. There are some solutions. But none of them looks like a
> standard way to do so. Does django have this feature?
> Leon
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to