def post(self): name = self.request.get("name") #check name name = name.strip() if len(name) == 0: self.template_value['error'] = True self.template_value['name'] = name return self.render('album_add.html') album = Album.add(name) self.redirect("/a/album/")
def put_song_in_album(song): if song.album_hash() not in album_map: album = Album(song.album, song.artist) album.add(song) try: album.add(getattr(song, 'APIC:')) except AttributeError: pass album_map[song.album_hash()] = album else: album = album_map[song.album_hash()] album.add(song) put_album_in_artist(album)