def choose_projection(cls, movie_id):
        from view.menu import Menu

        menu = """
        1)Choose a projection
        2)Cancel reservation
        """

        while (True):
            MovieController.show_projections_of_movie(movie_id)
            kwargs = Menu.get_input(menu, option=None)
            option = kwargs['option']
            if option == '1':
                try:
                    kwargs = Menu.get_input('', projection_by_id=None)
                    projection_id = kwargs['projection_by_id']
                    if cls.is_valid_id(projection_id, 'projection'):
                        return projection_id
                    else:
                        print("Invalid id\n")
                except Exception:
                    print("Invalid input!\n")

            elif option == '2':
                raise Exception("Canceling reservation...")

            else:
                print('Invalid option\n')
Пример #2
0
 def show_projections_of_movie(cls, movie_id):
     return MovieController.show_projections_of_movie(movie_id)