Пример #1
0
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()
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
 def __init__(self):
     self.model = Model()
Пример #6
0
class Controller:
    def __init__(self):
        self.model = Model()

    def add_movie(self, movie_obj):
        self.model.add_movie(movie_obj)
Пример #7
0
 def __init__(self):
     self.model = Model()
     self.controller = Controller(self.model)