def top_pages_by_time_period(self, interval='<STR_LIT>'):
date_trunc = fn.date_trunc(interval, PageView.timestamp)<EOL>return (self.get_query()<EOL>.select(<EOL>PageView.url,<EOL>date_trunc.alias(interval),<EOL>fn.Count(PageView.id).alias('<STR_LIT:count>'))<EOL>.group_by(PageView.url, date_trunc)<EOL>.order_by(<EOL>SQL(interval),<EOL>SQL('<STR_LIT:count>').desc(),<EOL>PageView.url))<EOL>
Get a breakdown of top pages per interval, i.e.

day         url     count
2014-01-01  /blog/  11
2014-01-02  /blog/  14
2014-01-03  /blog/  9