Пример #1
0
def find_artist(artist_name_in):
    try:
        searched_artist = Artist.get_or_none(
            Artist.artist_name == artist_name_in)
        return searched_artist
    except DatabaseError:  #as de:
        #return de
        return 'Sorry. There was an error retrieving the artist.'
Пример #2
0
    def test_add_artist(
        self
    ):  # Tests to see if it can retrieve an artists data after adding it to the database
        self.add_generic_sample_data()
        artworkDB.add_artist('Matthew', '*****@*****.**')

        artist = Artist.get_or_none(Artist.name == 'Matthew',
                                    Artist.email == '*****@*****.**')
        self.assertIsNotNone(artist)
Пример #3
0
def _get_artist_id(name):
    artist = Artist.get_or_none(Artist.name == name)
    artist_id = artist.id
    return artist_id