#17260: `QuerySet.dates()` is computed in UTC when time zone support is enabled
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  aaugustin
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by akaariai):

 You mean contentious as in "wontfix, breaks existing programs"? In my
 opinion that would be bad. It is pretty clear to me that the current
 behavior is broken. The dates should be in the currently active time zone.

 I think I know how to fix this:
  - aggregates can return parameters (useful for other features, too
 "conditional aggregates" for example). This is returning parameters from
 the cols part of the query.
  - other needed parts already can return parameters (where conditions
 etc).
  - use the AT TIME ZONE trick above, or if that is not available, use just
 " + timedelta offset minutes".
  - hope that everything works.
 The problem is there is a _lot_ of places to fix. In addition, the ORM is
 a little complex to work with sometimes. I just can't see getting this
 into 1.4 in time.

 Any way to mark this as a known bug which _will_ be fixed in the future?
 The other way forward is introducing "at_timezone" argument for the
 operations, but how to do that for `__date` for example?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17260#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to