Re: Stuck with simple query

2009-11-28 Thread Benjamin Wolf
Hi Steve, thx for the hint with de debug toolbar, very nice. It's working now, greets ben Steve Howell schrieb: > On Nov 28, 8:36 am, Benjamin Wolf wrote: > >> Hi, >> >> I'm trying to create a query like this with django: >> SELECT count(*) As total FROM `disposal` group by(salesman_id) >> >>

Re: Stuck with simple query

2009-11-28 Thread Steve Howell
On Nov 28, 8:36 am, Benjamin Wolf wrote: > Hi, > > I'm trying to create a query like this with django: > SELECT count(*) As total FROM `disposal` group by(salesman_id) > > This gives me the number of total sales for every salesman. > In django I tried this: > data = Disposal.objects.annotate(tota

Stuck with simple query

2009-11-28 Thread Benjamin Wolf
Hi, I'm trying to create a query like this with django: SELECT count(*) As total FROM `disposal` group by(salesman_id) This gives me the number of total sales for every salesman. In django I tried this: data = Disposal.objects.annotate(total=Count('salesman')) print str(x[0].total) But total is