Re: [Tutor] sorting objects in lists by 2 attr

2007-07-24 Thread Kent Johnson
Philippe Niquille wrote: > Tanks a mill! > > I don't know why I searched so far.. > > Anyway, I wrapped the django custom SQL call and built a nice dictionary > out of the resulting rows (which is similar to querysets). > See http://www.djangosnippets.org/snippets/207/ >

Re: [Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Eric Brunson
SQL databases are cool. Make them do as much as they can for you. :-) Philippe Niquille wrote: > Tanks a mill! > > I don't know why I searched so far.. > > Anyway, I wrapped the django custom SQL call and built a nice > dictionary out of the resulting rows (which is similar to querysets). > S

Re: [Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Philippe Niquille
Tanks a mill! I don't know why I searched so far.. Anyway, I wrapped the django custom SQL call and built a nice dictionary out of the resulting rows (which is similar to querysets). See http://www.djangosnippets.org/snippets/207/ for details. Philippe Am 23.07.2007 um 19:28 schrieb Eric Brunso

Re: [Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Eric Walstad
Philippe Niquille wrote: > Using django I get a QuerySet of Score objects which are sorted by the > actual score, the actual score divided by the max. possible score (so > sorting by two db fields). > > I then need to loop through that queryset and sum up all the score > objects which belong to th

Re: [Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Alan Gauld
"Philippe Niquille" <[EMAIL PROTECTED]> wrote > The problem I now have, is that I lost the sorting order, as > described > above. How would I resort it with a python algortithm instead of > SQL? Why not use SQL? Best to get the highest quality data into your program that you can, the earlier

Re: [Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Eric Brunson
Philippe Niquille wrote: > > Hi > > > I have a hard time sorting an object list. Perhaps this is kind of a > noob question, but I would very much appreciate any help! > > > Using django I get a QuerySet of Score objects which are sorted by the > actual score, the actual score divided by the max.

[Tutor] sorting objects in lists by 2 attr

2007-07-23 Thread Philippe Niquille
Hi I have a hard time sorting an object list. Perhaps this is kind of a noob question, but I would very much appreciate any help! Using django I get a QuerySet of Score objects which are sorted by the actual score, the actual score divided by the max. possible score (so sorting by two db field