Beispiel #1
0
def addBbhqPitcherLine(line, player):
    newPitcher = PitcherYearLine()
    newPitcher.player = player
    newPitcher.label = 'BBHQ Proj'
    newPitcher.yearLabel = '2012'
    newPitcher.age = line['Age']
    newPitcher.team = line['Tm']
    newPitcher.mmCode = line['MM Code']
    newPitcher.dlDays = line['DL']
    newPitcher.inningsPitched = line['IP']
    newPitcher.era = line['ERA']
    newPitcher.xera = line['xERA']
    newPitcher.hitsAllowed = line['H']
    newPitcher.earnedRuns = line['ER']
    newPitcher.walksAllowed = line['BB']
    newPitcher.strikeouts = line['K']
    newPitcher.wins = line['W']
    newPitcher.saves = line['Sv']
    newPitcher.dollarValue = line['12$']
    newPitcher.games = line['G']
    newPitcher.qualityStarts = line['QS']
    newPitcher.whip = line['WHIP']
    newPitcher.bb9 = line['BB9']
    newPitcher.k9 = line['K9']
    newPitcher.kbbRatio = float(newPitcher.strikeouts) / float(newPitcher.walksAllowed)
    newPitcher.groundBallRatio = line['G%']
    newPitcher.lineDriveRatio = line['L%']
    newPitcher.flyBallRatio = line['F%']
    newPitcher.hitRatio = line['H%']
    newPitcher.bpv = line['BPV']

    newPitcher.player.save()
    newPitcher.save()