Пример #1
0
 def get(self):
     sq = Song.all().filter("owner =", users.get_current_user())
     songs = sq.fetch(100)
     
     songs_json = format_json(songs)
     
     self._print('{"songs":[%s]}' % songs_json)
Пример #2
0
 def get(self):
     songsQuery = Song.all().order('-date')
     songs = songsQuery.fetch(100)
 
     songs_json = format_json(songs)
 
     self._print('{"songs":[%s]}' % songs_json)
Пример #3
0
 def get(self, authorName):
     authorName = re.sub('_', ' ', authorName)
     
     #sq = Song.gql("WHERE author = '%s' ORDER BY date ASC" % authorName)
     sq = Song.all().filter("author =", authorName).order("date")
     songs = sq.fetch(100)
     
     songs_json = format_json(songs)
     
     self._print('{"songs":[%s]}' % songs_json)
Пример #4
0
 def get(self):
     pq = Playlist.all().filter("owner =", users.get_current_user())
     playlists = pq.fetch(1)
     if len(playlists) == 0:
         self.response.out.write('No playlists')
         return
     
     psq = PlaylistSong.all().filter("playlist =", playlists[0])
     psongs = psq.fetch(100)
     songs = []
     for ps in psongs:
         songs.append(ps.song)
     
     songs_json = format_json(songs)
     
     self._print('{"songs":[%s]}' % songs_json)
Пример #5
0
 def get(self, author_name):
     author_name = re.sub('_', ' ', author_name)
     
     sq = Song.all().filter("author =", author_name).order("date")
     
     self._print('{"songs":[%s]}' % format_json(sq.fetch(100)))