def __init__(self): # Grid initialization super(EditTournamentsGrid, self).__init__(Tournament, Tournament.all(order_by_clause=Tournament.tournament_dt)) #@UndefinedVariable # Creation of a customized date field to edit the tournaments' date self.append(create_date_field("formatted_tournament_dt", "tournament_dt", DT_FORMAT)) # Grid configuration inc = [SEASON_READONLY(self.season_id), POSITION_READONLY(self.position), FORMATTED_DT(self.formatted_tournament_dt), BUYIN(self.buyin)] self.configure(include=inc)
def test_all(self): all_tournaments = Tournament.all() self.assertEqual(len(all_tournaments), 3)
def __init__(self): """Init.""" super().__init__() self.title = "Choose a tournament to continue" self.all_tournaments = Tournament.all()