def get(self): args = auth_parser.parse_args() artist = authentication_header_parser(args['Authorization']) artist_albums = (AlbumModel.query.filter_by( artist_id=artist['id']).order_by('id').all()) return artist_albums
def get(self, album_id): args = auth_parser.parse_args() artist = authentication_header_parser(args['Authorization']) artist_album = (AlbumModel.query.filter_by( id=album_id, artist_id=artist['id']).first()) if not artist_album: return '', http.client.NOT_FOUND return artist_album
def delete(self, song_id): args = auth_parser.parse_args() artist = authentication_header_parser(args['Authorization']) artist_song = (SongModel.query.filter_by( id=song_id, artist_id=artist['id']).first()) if artist_song: db.session.delete(artist_song) db.session.commit() return '', http.client.NO_CONTENT
def delete(self, album_id): args = auth_parser.parse_args() artist = authentication_header_parser(args['Authorization']) artist_album = (AlbumModel.query.filter_by( id=album_id, artist_id=artist['id']).first()) if not artist_album: return '', http.client.NOT_FOUND db.session.delete(artist_album) db.session.commit() return '', http.client.NO_CONTENT