Release notes and documentation don't mention queryset week_day breakage on mysql if you haven't loaded tzinfo
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)
Owner: |
changed from nobody to Aymeric Augustin
|
Severity: |
Normal → Release blocker
|
Status: |
new → assigned
|
Has patch: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
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