Re: Count filtered by status

2009-03-21 Thread Jamie Pittock
Malcolm, thanks very much for this. I don't have time to properly look at this until Monday but I wanted to at least acknowledge before then my appreciation of your replies. I'll no doubt be back with either more thanks or more questions. On Mar 21, 4:55 am, Malcolm Tredinnick

Re: Count filtered by status

2009-03-20 Thread Malcolm Tredinnick
On Sat, 2009-03-21 at 15:48 +1100, Malcolm Tredinnick wrote: [...] > {% regroup status_counts by provider as s_counts %} > > {% for object in s_counts %} >{% ifchanged object.provider %} > {{ object.provider__name }} > {{

Re: Count filtered by status

2009-03-20 Thread Malcolm Tredinnick
On Sat, 2009-03-21 at 15:32 +1100, Malcolm Tredinnick wrote: > [...] > You then have something you can either merge with the provider objects > in the view (assigning each dictionary to an attribute on the provider > object that matches the "provider" key), or use some other way in the >

Re: Count filtered by status

2009-03-20 Thread Malcolm Tredinnick
On Fri, 2009-03-20 at 03:01 -0700, Jamie Pittock wrote: > Hi all, > > I have two models, Provider and Record. Record has the foreign key > provider_id. In my template I'm displaying how many records a > provider has by using object.record__set.count. If Record had a > status field, how would

Count filtered by status

2009-03-20 Thread Jamie Pittock
Hi all, I have two models, Provider and Record. Record has the foreign key provider_id. In my template I'm displaying how many records a provider has by using object.record__set.count. If Record had a status field, how would I display how many records with a particular status a provider had?