Changes between Initial Version and Version 1 of Ticket #30726, comment 4


Ignore:
Timestamp:
Aug 27, 2019, 4:23:55 PM (5 years ago)
Author:
Andrew Williams

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30726, comment 4

    initial v1  
    11Looking more into this, it turns out that this is a side-effect of mysql not having the timezone definitions in the database (See https://docs.djangoproject.com/en/dev/ref/models/querysets/#database-time-zone-definitions)
    22
    3 Behind the scenes, the 'filter(last_modified__week__gte=0,last_modified__week__lte=53).count()' query above gets translated into:
     3Behind the scenes, the first query above gets translated into:
    44{{{
    55 SELECT COUNT(*) AS `__count` FROM `mymodel_reportconfig` WHERE (WEEK(CONVERT_TZ(`mymodel_reportconfig`.`last_modified`, 'UTC', 'UTC'), 3) >= 0 AND WEEK(CONVERT_TZ(`mymodel_reportconfig`.`last_modified`, 'UTC', 'UTC'), 3) <= 53)
Back to Top