STY: Use named args for Transaction object creation.

Instead of creating and passing a dict of the object values,
use named args directly.
This commit is contained in:
Eddie Hebert
2013-11-01 16:10:19 -04:00
parent a192ba01a2
commit 1575867b40
+7 -8
View File
@@ -141,15 +141,14 @@ def create_transaction(event, order, price, amount):
if amount_magnitude < 1:
raise Exception("Transaction magnitude must be at least 1.")
txn = {
'sid': event.sid,
'amount': int(amount),
'dt': event.dt,
'price': price,
'order_id': order.id
}
transaction = Transaction(
sid=event.sid,
amount=int(amount),
dt=event.dt,
price=price,
order_id=order.id
)
transaction = Transaction(**txn)
return transaction