Exemplo n.º 1
0
    def action(self, option):
        try:
            id = int(option)
            model = Storage.get(id)
            if not model:
                return None

            return DetailsView(model)
        except ValueError:            
            if option == "b":
                return MainView()
            if option == "a":
                return AddView()
        
        return None