本文整理汇总了Python中DataModel.setTeamInfoFromTba方法的典型用法代码示例。如果您正苦于以下问题:Python DataModel.setTeamInfoFromTba方法的具体用法?Python DataModel.setTeamInfoFromTba怎么用?Python DataModel.setTeamInfoFromTba使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataModel
的用法示例。
在下文中一共展示了DataModel.setTeamInfoFromTba方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_team_info
# 需要导入模块: import DataModel [as 别名]
# 或者: from DataModel import setTeamInfoFromTba [as 别名]
def load_team_info( global_config, name=None):
session = DbSession.open_db_session(global_config['db_name'] + global_config['this_season'])
if name is None:
global_config['logger'].debug( 'Loading Team Info For All FRC Teams' )
page = 0
done = False
while not done:
url_str = '/api/v2/teams/%d' % (page)
teams_data = TbaIntf.get_from_tba_parsed(url_str)
if len(teams_data) == 0:
done = True
else:
for team_data in teams_data:
DataModel.setTeamInfoFromTba(session, team_data)
page += 1
else:
global_config['logger'].debug( 'Loading Team Info For FRC Team %s' % name )
'''
url_str = '/api/v2/team/frc%s/%s' % (team_str,query_str)
for page in range(0,14):
teams_data = TbaIntf.get_from_tba_parsed(url_str)
for team_data in teams_data:
setTeamInfoFromTba(session, team_data)
'''
session.remove()