def get(self): start_date = datetime.datetime.now() - datetime.timedelta(days=2) events = models.getEventsAfter(start_date) template_values = { 'events': events, } self.response.out.write( template.render(getPath("events.html"), template_values))
def get(self): ## Album list disabled until it is further optimized. # album_list = [] album_list = cache.getNewAlbums(num=36) start = datetime.datetime.now() - datetime.timedelta(weeks=1) end = datetime.datetime.now() song_num = 10 album_num = 10 top_songs, top_albums = models.getTopSongsAndAlbums(start, end, song_num, album_num) posts = models.getLastPosts(3) events = models.getEventsAfter(datetime.datetime.now() - datetime.timedelta(days=1), 3) template_values = { "flash": self.flash, "session": self.session, "album_list": album_list, "top_songs": top_songs, "top_albums": top_albums, "posts": posts, "events": events, } self.response.out.write(template.render(getPath("index.html"), template_values))
def get(self): ## Album list disabled until it is further optimized. #album_list = [] album_list = cache.getNewAlbums(num=36) start = datetime.datetime.now() - datetime.timedelta(weeks=1) end = datetime.datetime.now() song_num = 10 album_num = 10 top_songs, top_albums = models.getTopSongsAndAlbums( start, end, song_num, album_num) posts = models.getLastPosts(3) events = models.getEventsAfter( datetime.datetime.now() - datetime.timedelta(days=1), 3) template_values = { 'flash': self.flash, 'session': self.session, 'album_list': album_list, 'top_songs': top_songs, 'top_albums': top_albums, 'posts': posts, 'events': events, } self.response.out.write( template.render(getPath("index.html"), template_values))
def get(self): start_date = datetime.datetime.now() - datetime.timedelta(days=2) events = models.getEventsAfter(start_date) template_values = {"events": events} self.response.out.write(template.render(getPath("events.html"), template_values))