Ejemplo n.º 1
0
    def delete(*, artist: ArtistModel = None, name: str = None) -> None:
        assert artist or name

        if not artist:
            artist = ArtistModel.read(name=name)

        artist.delete()
Ejemplo n.º 2
0
    def create(*,
               album: AlbumModel,
               artist: ArtistModel = None,
               artist_name: str = None) -> None:
        assert artist or artist_name

        if not artist:
            artist = ArtistModel.read(name=artist_name)

        artist.albums.append(album)
        album.save()
Ejemplo n.º 3
0
 def read(*, name: str) -> Union[ArtistModel, None]:
     return ArtistModel.read(name=name)