예제 #1
0
def get_available_art_by_artist(artist):
    """ Get a list of art by artist that matches search term and art is aviailable
    :param term(the user input)
    :returns list of art by artist that is available 
    """
    available_art = Artwork.select().where( (Artwork.art_available == True) & (Artwork.artist == artist))
    return available_art
예제 #2
0
def get_all_artwork_of_artist(name):#returning all artwork by artist

   
    try:
        artwork_list = []
        for art in Artwork.select().join(Artist).where(Artist.name == Artwork.artist):
            artwork_list.append(Artwork.name)
            return ', '.join(artwork_list)
    except:
        print('no found an art')
예제 #3
0
def get_available_artwork_of_artist(name):#returnig all available artwork by artist

    

    artwork_list = []

    for art in Artwork.select().join(Artist).where(

        (Artist.name == artist) & (Artwork.available == True)):

        artwork_list.append(art.Artwork.name)

    return ', '.join(artwork_list)
예제 #4
0
def search_artist_artwork(term):
    # search for all the artwork by an artist (everything - available and sold)
    query = Artwork.select().where((Artwork.artist).contains(term.lower()))
    return list(query)
예제 #5
0
def all_available_art():
    # display for all the available artwork by an artist
    available_art = Artwork.select().where(
        Artwork.available == True) & (Artwork.artist == artist)
    for artworks in available_art:
        return artworks
예제 #6
0
def artist_art_search(term):
    query = Artwork.select().where( ( fn.LOWER(Artwork.artist).contains(term.lower() ) ) )
    return list(query)
예제 #7
0
def artwork_count():
    return Artwork.select().count()
예제 #8
0
def get_all_artwork():
    query = Artwork.select()
    return list(query)
예제 #9
0
def get_artwork_by_sold_value(sold):
    query = Artwork.select().where(Artwork.sold == sold)
    return list(query)
예제 #10
0
def get_artwork_by_available_value(available):
    query = Artwork.select().where(Artwork.available == available)
    return list(query)
예제 #11
0
def search_artwork(term):
    query = Artwork.select().where((fn.LOWER(Artwork.artwork_name).contains(term.lower())))
    return list(query)