Re: Count by date

2009-12-12 Thread philadams
i believe the way filters work (what martin referenced) is that you have to explicitly say which weekday you care about. what the op is looking for is a way to group by week day. ideally to write something like MyTable.objects.values(created__week_day).annotate (Count('id')) however, this doesn't

Re: Count by date

2009-11-23 Thread Martin Ostrovsky
You can limit your search by year, month or day. See http://docs.djangoproject.com/en/dev/ref/models/querysets/#year On Nov 20, 1:59 pm, Simon wrote: > Hi all, > > I am sure this must be a real noob question as it's so easy to do in > SQL. > I am trying to replicate something like the following

Count by date

2009-11-23 Thread Simon
Hi all, I am sure this must be a real noob question as it's so easy to do in SQL. I am trying to replicate something like the following in Django: SELECT DATE(created) AS created_day, COUNT(id) AS NumberOf FROM my_table GROUP BY created_day Effectively, all I want to do is a count grouped by