I am using Django 1.5.1, Python 3.3.x, and can not use raw queries for it .
Can QuerySet be grouped by a QuerySet group, whose date uses the I have been trying different tweaks with the code> Excluded, here is a new way of group on weekdays. Import django.db.models.functions from This will return as a result: It is also important to note that 1 = Sunday and Saturday = 7 __ range filter? I am trying to group results in the weekdays, for a query that is between any two dates (can be equivalent to one year). I know how, but for this to find data for every past day, DB has to be fastened with 7 questions.
__ day of the week filter, but trying to figure it out for a two hour by not working Am Even Googling does not help, so I wonder if this is also possible. Here, any degenerate guru knows how to do this, if
extra
ExtractWeekDay YourObjects.objects .annotate (weekday = ExtractWeekDay ('timestamp')) .values ('weekday'). Anotate (count = count ('id')). Value ('workday', 'count')
[['day of week': 1, 'count ': 534}, {' Workday ': 2,' Count ': 574}, .......}
No comments:
Post a Comment