Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21095 closed Bug (fixed)

Release notes and documentation don't mention queryset week_day breakage on mysql if you haven't loaded tzinfo

Reported by: Matt Austin Owned by: Aymeric Augustin
Component: Documentation Version: 1.6-beta-1
Severity: Release blocker Keywords: releasenotes
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

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 Aymeric Augustin, 11 years ago

Owner: changed from nobody to Aymeric Augustin
Severity: NormalRelease blocker
Status: newassigned

comment:2 by anonymous, 11 years ago

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

comment:3 by Tim Graham, 11 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:4 by Aymeric Augustin, 11 years ago

Triage Stage: AcceptedReady 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 Aymeric Augustin <aymeric.augustin@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 9451d8d558e6dafa4e270c33608a291610ccf77d:

Fixed #21095 -- Documented new requirement for dates lookups.

Day, month, and week_day lookups now require time zone definitions in the database.

comment:6 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

In a929adfd3b89056d83c34f729bedde78afec44db:

[1.6.x] Fixed #21095 -- Documented new requirement for dates lookups.

Day, month, and week_day lookups now require time zone definitions in the database.

Backport of 9451d8d from master.

Note: See TracTickets for help on using tickets.
Back to Top