示例#1
0
文件: artwork.py 项目: yp0975eu/p3
def show_all_available():
    artworks = Artwork.select().where(Artwork.sold == False)
    if artworks:
        for artwork in artworks:
            ui.display(format_artwork(artwork))
    else:
        ui.display('No artwork found')
示例#2
0
def get_all_available_artwork(artist_id_in):
    try:
        return Artwork.select().where(Artwork.artist_id == artist_id_in,
                                      Artwork.available == 1)
    except DatabaseError:  #as de:
        #return de
        return 'Sorry. There was an error retrieving the artwork'
示例#3
0
def get_all_artwork(artist_id_in):
    try:
        return Artwork.select().join(
            Artist, on=(Artist.artist_id == Artwork.artist_id)).where(
                Artwork.artist_id == artist_id_in)
    except DatabaseError:  #as de:
        #return de
        return 'Sorry. There was an error retrieving the artwork'
示例#4
0
文件: artwork.py 项目: yp0975eu/p3
def show_all_available_by_artist():
    artist_control.show_all()
    artist = artist_control.get_by_id()
    artworks = Artwork.select().where(Artwork.sold == False, Artwork.artist == artist)
    if artworks:
        for artwork in artworks:
            ui.display(format_artwork(artwork))
    else:
        ui.display('No artwork found')
def get_all_artwork():
    artwork = Artwork.select()
    return artwork
def search_available_by_artist(name):
    artworks = Artwork.select().join(Artist).where((Artist.name == name) &
                                                   (Artwork.available == True))
    return artworks
def search_artwork_by_artist(name):
    artworks = Artwork.select().join(Artist).where(Artist.name == name)
    return artworks
示例#8
0
文件: artwork.py 项目: yp0975eu/p3
def show_all():
    artworks = Artwork.select()
    for artwork in artworks:
        ui.display(format_artwork(artwork))