def get(self): #the only purpose of this is to clear all music #should be disabled except when debugging songs = Song.all() for song in songs: song.delete() self.redirect('/musicrequest')
def get(self): # IMPLEMENT MEMCACHE HERE songlist = memcache.get("songs") ip = self.request.remote_addr previous_user = memcache.get(ip) if previous_user is None: previous_user = model.SongRequester.all().filter('ip=', ip).get() if songlist is None: songs = Song.all().order('-date') songlist = songs.fetch(20) memcache.add("songs", songlist) template_values = {'songs' : songlist, 'heading' : 'Song Request', 'previous_user' : previous_user} if self.request.get('error') == '1': template_values['error'] = 'At the very least, I need the title of the song, or an artist.' self.generate('music.html', template_values)
def get(self): full_list = memcache.get("songs_full_list") if full_list is None: full_list = Song.all().order('artist') template_values = {'songs' : full_list} self.generate('full_music_list.html', template_values)