#21095 closed Bug (fixed)
Release notes and documentation don't mention queryset week_day breakage on mysql if you haven't loaded tzinfo
Description ¶
When switching to Django 1.6b2, queries such as MyModel.objects.filter(start_at__week_day=1)
started returning empty querysets. After investigation, it turned out I had to load tzinfo in to the database, as described at https://docs.djangoproject.com/en/1.6/ref/models/querysets/#database-time-zone-definitions. Although the release notes mention this is required for the new QuerySet.datetimes() functionality, there was nothing mentioning it was required for using week_day lookups.
As this could break previously working projects with Django 1.5, it should probably be made clear in the release notes and queryset documentation.
Change History (6)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Severity: | Normal → Release blocker |
Status: | new → assigned |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 11 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Pull request looks good, I'll edit it a bit to provide the solution immediately instead of redirecting the user to another page.
This creates a bit of duplications but it's only two lines and it doesn't matter if it goes stale; the release notes only need to stay accurate while the release is supported.
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've added some notes for the requirement of database time zone definitions for day, month, and week_day lookups.
Pull request for master (will also need to be cherry-picked to stable-1.6.x / stable-1.7.x branches):
https://github.com/django/django/pull/1620