Exemplo n.º 1
0
def search_exists(search, select, repo: AbstractRepository):
    genres = repo.get_genres()
    actors = repo.get_actors()
    directors = repo.get_directors()
    if select == "Genre":
        if Genre(search) in genres:
            return True
        else:
            return False
    elif select == "Actor":
        if Actor(search) in actors:
            return True
        else:
            return False
    elif select == "Director":
        if Director(search) in directors:
            return True
        else:
            return False
Exemplo n.º 2
0
def search_exists(search, select, repo: AbstractRepository):

    if select == "Actor":
        if Actor(search) not in repo.get_actors():
            return False
        else:
            return True

    elif select == "Genre":
        if Genre(search) not in repo.get_genres():
            return False
        else:
            return True

    elif select == "Director":
        if Director(search) not in repo.get_directors():
            return False
        else:
            return True
Exemplo n.º 3
0
def get_director_names(repo: AbstractRepository):
    directors = repo.get_directors()
    director_names = [director.director_full_name for director in directors]

    return director_names