Code

Opened 7 months ago

Closed 7 months ago

Last modified 7 months 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: mattaustin Owned by: aaugustin
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.

Attachments (0)

Change History (6)

comment:1 Changed 7 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to aaugustin
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Status changed from new to assigned

comment:2 Changed 7 months ago by anonymous

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 Changed 7 months ago by timo

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 7 months ago by aaugustin

  • Triage Stage changed from Accepted to 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 Changed 7 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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 Changed 7 months ago by Aymeric Augustin <aymeric.augustin@…>

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.