Changes between Initial Version and Version 1 of Ticket #30726, comment 4
- Timestamp:
- Aug 27, 2019, 4:23:55 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30726, comment 4
initial v1 1 1 Looking 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) 2 2 3 Behind the scenes, the 'filter(last_modified__week__gte=0,last_modified__week__lte=53).count()'query above gets translated into:3 Behind the scenes, the first query above gets translated into: 4 4 {{{ 5 5 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)