테스트
This commit is contained in:
17
transaction.py
Normal file
17
transaction.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
class Transaction:
|
||||
def __init__(self):
|
||||
self.time = None
|
||||
self.price = None
|
||||
self.unit = 0
|
||||
self.type = None
|
||||
|
||||
def __init__(self, item):
|
||||
self.time = item['transaction_date']
|
||||
self.price = int(item['price'])
|
||||
self.unit = float(item['units_traded'])
|
||||
self.type = item['type']
|
||||
|
||||
def __str__(self, **kwargs):
|
||||
return '[{}] {} {}'.format(self.time, self.type, self.price)
|
||||
Reference in New Issue
Block a user