class Controller: def __init__(self): self.model = Model() def add_movie(self, movie_obj): self.model.add_movie(movie_obj) def get_all_movies(self): return self.model.get_all_movies()
class Conector: def __init__(self): self.model = Model() def add_movie(self, movie_obj): self.model.add_movie(movie_obj) def show_all(self): return self.model.get_all_movie() def dump(self): self.model.dump_to_yml()
class View: def __init__(self): self.controller = Controller() self.model = Model() def show_all(self): movies = self.model.get_all_movies() for movie in movies: print(movie, end='\n\n') def add_movie(self, movie_obj): self.controller.add_movie(movie_obj)
class View: def __init__(self): self.controller = Controller() self.model = Model() def show_all(self): movies = self.model.load() for movie in movies: print(movie) def add_movie(self, movie_obj): self.controller.add_movie(movie_obj)
def __init__(self): self.model = Model()
class Controller: def __init__(self): self.model = Model() def add_movie(self, movie_obj): self.model.add_movie(movie_obj)
def __init__(self): self.model = Model() self.controller = Controller(self.model)