After importing blog entries from wordpress I found that they are not shown 
on /blog/archive/YYYY/MM/. Empty lists for any month of any year.
Though they are shown on /blog/ or /blog/archive/YYYY/

It appeared that Django 1.6 introduced time zone support in database 
queries, so filter(publish_date__month=...) becomes 
AND EXTRACT(MONTH FROM CONVERT_TZ(`blog_blogpost`.`publish_date`, 'UTC', 
'your_timezone')) = ...)
in MySQL queries: 
https://docs.djangoproject.com/en/1.6/releases/1.6/#time-zone-aware-day-month-and-week-day-lookups

This affects only day, month and week_day lookups. Year is not affected, 
filter(publish_date__year=year) is still using direct timestamps and works 
as expected:
AND `blog_blogpost`.`publish_date` BETWEEN '2014-01-01 00:00:00' and 
'2014-12-31 23:59:59'

The problem is that CONVERT_TZ in MySQL requires timezone data in 
mysql.time_zone* tables. They are empty by default, so CONVERT_TZ always 
returns NULL and lookup query returns an empty list.
You have to run 
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
to import OS timezone information into these tables. See 
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html for further 
details.

Stephen, will you please add this information to the Installation guide or 
to FAQs?

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to