本文整理汇总了Python中models.Team.elim1方法的典型用法代码示例。如果您正苦于以下问题:Python Team.elim1方法的具体用法?Python Team.elim1怎么用?Python Team.elim1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Team
的用法示例。
在下文中一共展示了Team.elim1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from models import Team [as 别名]
# 或者: from models.Team import elim1 [as 别名]
for i in range(80):
team = Team(
number=i,
name="My Team %i" % (i),
affiliation="Some %i School" % (i),
round1=random.randrange(0, 400, 1),
round2=random.randrange(0, 400, 1),
round3=random.randrange(0, 400, 1),
round4=random.randrange(0, 400, 1),
round5=random.randrange(0, 400, 1))
teams.append(team)
# Top 12
for team in api.rankTeams(teams)[:12]:
team.advanceTo4 = True
team.elim1=random.randrange(0, 400, 1)
# Top 4
for team in sorted(teams, key=lambda x: x.elim1, reverse=True)[:4]:
team.advanceTo5 = True
team.elim2=random.randrange(0, 400, 1)
#Top 2
for team in sorted(teams, key=lambda x: x.elim2, reverse=True)[:2]:
team.advanceTo6 = True
team.elim3=random.randrange(0, 400, 1)
# Add all teams to database
for team in teams:
DB.session.add(team)