-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0228a86
commit 5096ae4
Showing
4 changed files
with
35 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
from .transaction_item import TransactionItem | ||
|
||
class Transaction(object): | ||
def __init__(self, data, player_map, get_team_data): | ||
self.team = get_team_data(data['teamId']) | ||
self.type = data['type'] | ||
self.status = data['status'] | ||
self.scoring_period = data['scoringPeriodId'] | ||
self.date = data['processDate'] | ||
self.bid_amount = data['bidAmount'] | ||
self.date = data.get('processDate') | ||
self.bid_amount = data.get('bidAmount') | ||
self.items = [] | ||
for item in data['items']: | ||
self.items.append(TransactionItem(item, player_map)) | ||
|
||
def __repr__(self): | ||
items = ', '.join([str(item) for item in self.items]) | ||
return f'Transaction({self.team.team_name} {self.type} {items})' | ||
|
||
class TransactionItem(object): | ||
def __init__(self, data, player_map): | ||
self.type = data['type'] | ||
self.player = player_map[data['playerId']] | ||
|
||
def __repr__(self): | ||
return f'{self.type} {self.player}' |
This file was deleted.
Oops, something went wrong.