Exemple #1
0
 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))
Exemple #2
0
 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))
Exemple #3
0
 def get(self):
   album_list = cache.getNewAlbums(num=36)
   self.json_respond({
       'album_list': [album.to_json() for album in album_list]
       })
Exemple #4
0
 def get(self):
     album_list = cache.getNewAlbums(num=36)
     self.json_respond(
         {'album_list': [album.to_json() for album in album_list]})