def populate(self): if Team.select().count(): flash("The tables are already populated.") else: for team in generate_teams(): Team(**team) flash("The tables have been populated now.") redirect("/")
def week(self, num=None): if num == None: weeks = Week.select(Week.q.data_entered==True) return dict(data=[], datagrid=None, weeks=weeks, num=num) data = Team.select().filter(Game.q.weekID==num) return dict(data=data, datagrid=week_datagrid, num=num)
def index(self): teams = Team.select() return dict(data=teams, datagrid=teams_datagrid)