'Create a Transaction object based on information in the database.'

@classmethod
def from_database(cls, data, payments):

    (trader_id, transaction_number, order_trader_id, order_number, partner_trader_id, partner_order_number, price, price_type, transferred_price, quantity, quantity_type, transferred_quantity, transaction_timestamp, sent_wallet_info, received_wallet_info, incoming_address, outgoing_address, partner_incoming_address, partner_outgoing_address) = data
    transaction_id = TransactionId(TraderId(str(trader_id)), TransactionNumber(transaction_number))
    transaction = cls(transaction_id, Price(price, str(price_type)), Quantity(quantity, str(quantity_type)), OrderId(TraderId(str(order_trader_id)), OrderNumber(order_number)), OrderId(TraderId(str(partner_trader_id)), OrderNumber(partner_order_number)), Timestamp(float(transaction_timestamp)))
    transaction._transferred_price = Price(transferred_price, str(price_type))
    transaction._transferred_quantity = Quantity(transferred_quantity, str(quantity_type))
    transaction.sent_wallet_info = sent_wallet_info
    transaction.received_wallet_info = received_wallet_info
    transaction.incoming_address = WalletAddress(str(incoming_address))
    transaction.outgoing_address = WalletAddress(str(outgoing_address))
    transaction.partner_incoming_address = WalletAddress(str(partner_incoming_address))
    transaction.partner_outgoing_address = WalletAddress(str(partner_outgoing_address))
    transaction._payments = payments
    return transaction
