本文整理汇总了Python中models.team.Team.find_by_name方法的典型用法代码示例。如果您正苦于以下问题:Python Team.find_by_name方法的具体用法?Python Team.find_by_name怎么用?Python Team.find_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.team.Team
的用法示例。
在下文中一共展示了Team.find_by_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models.team import Team [as 别名]
# 或者: from models.team.Team import find_by_name [as 别名]
def get(self, user, league_name, team_name, season_name):
escaped_league_name = urllib.unquote(league_name)
escaped_team_name = urllib.unquote(team_name)
escaped_season_name = urllib.unquote(season_name)
league = League.find_by_name(escaped_league_name)
team = Team.find_by_name(name = escaped_team_name, location = None, league = league)
season = Season.find_by_league_and_name(league = league, name = escaped_season_name)
if team and season:
self.render_html(team = team, season = season, msg = None, user = user)
else:
self.set_404("html", user)