当前位置: 首页>>代码示例>>Python>>正文


Python DataModel.getTeamAttribute方法代码示例

本文整理汇总了Python中DataModel.getTeamAttribute方法的典型用法代码示例。如果您正苦于以下问题:Python DataModel.getTeamAttribute方法的具体用法?Python DataModel.getTeamAttribute怎么用?Python DataModel.getTeamAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataModel的用法示例。


在下文中一共展示了DataModel.getTeamAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: str

# 需要导入模块: import DataModel [as 别名]
# 或者: from DataModel import getTeamAttribute [as 别名]
                mystring += ',' + attr_def['Name']
    except Exception, e:
        print 'Exception: %s' % str(e)

    mystring += '\n'
    fo.write( mystring )
    
    # Get the list of teams in rank order, then loop through teams and dump their stored
    # attribute values
    team_rankings = DataModel.getTeamsInRankOrder(session, competition)
    for team_entry in team_rankings:
        mystring = str(team_entry.team) + ',' + str(team_entry.score)
        # retrieve each attribute from the database in the proper order
        for attr_def in attr_order:
            if attr_def['Database_Store'] == 'Yes':
                attribute = DataModel.getTeamAttribute(session, team_entry.team, competition, attr_def['Name'])
                # if the attribute doesn't exist, just put in an empty field so that the columns
                # stay aligned
                if attribute == None:
                    mystring += ','
                elif ( attr_def['Statistic_Type'] == 'Total'):
                    #mystring += ',' + str(attribute.cumulative_value)
                    mystring += ',' + DataModel.mapValueToString(attribute.cumulative_value, attribute.all_values, attr_def)
                elif ( attr_def['Statistic_Type'] == 'Average'):
                    #mystring += ',' + str(attribute.avg_value)
                    mystring += ',' + DataModel.mapValueToString(attribute.avg_value, attribute.all_values, attr_def)
                else:
                    #mystring += ',' + str(attribute.attr_value)
                    mystring += ',' + DataModel.mapValueToString(attribute.attr_value, attribute.all_values, attr_def)

        mystring += '\n'
开发者ID:mbhoude,项目名称:ScoutingAppCentral,代码行数:33,代码来源:ScoutingAppMain.py


注:本文中的DataModel.getTeamAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。