Re: Efficient Grouping of Database Query

2010-12-28 Thread Daniel Roseman
On Monday, December 27, 2010 7:33:42 PM UTC, greg wrote: > > Hi, I'm trying to render a page with a table of records. > > Each entry in the table is a 'Lift' which I need grouped by > weight_class and then only the top result for each lift shown. > > So far example if I have something like this

Re: Efficient Grouping of Database Query

2010-12-27 Thread Mayuresh Phadke
You could use the "regroup" template tag to achieve this. http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup Regards, Mayuresh http://twitter.com/#!/ geeroo http://twit

Efficient Grouping of Database Query

2010-12-27 Thread greg
Hi, I'm trying to render a page with a table of records. Each entry in the table is a 'Lift' which I need grouped by weight_class and then only the top result for each lift shown. So far example if I have something like this in the database: weight_class | event | weight 132