I can't comment on "sharded counter", but just FYI, python has a built in
method called "sum" that you can apply to lists or tuples, without writing
your own loop.
aList = [1,2,3]
bTup = (1,2,3)

sum(aList) or sum(bList) return 6.

On Wed, Feb 11, 2009 at 7:51 PM, Barry Hunter
<[email protected]>wrote:

>
> Search the group for 'sharded counter' - the same technique should
> work equally well for calculating a sum.
>
> On 11/02/2009, Neversummer <[email protected]> wrote:
> >
> >  I want to get a total (sum) from an property on a given entity. I know
> >  that sum() is not supported. Is the best method to query for all
> >  records on the entity in question and work through a loop adding each
> >  records value (the value of the property in question) to a total
> >  variable?
> >
> >  It's worth noting that I am brand new to google app engine and to
> >  python. Thanks for any suggestions.
> >
> >  >
> >
>
>
> --
> Barry
>
> - www.nearby.org.uk - www.geograph.org.uk -
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to