Ejemplo n.º 1
0
 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("/")
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 def index(self):
     teams = Team.select()
     return dict(data=teams, datagrid=teams_datagrid)