'Add a specific transaction to the database'

def add_transaction(self, transaction):

    self.execute(u'INSERT    INTO    transactions    (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)    VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', transaction.to_database())
    self.commit()
    self.delete_payments(transaction.transaction_id)
    for payment in transaction.payments:
        self.add_payment(payment)
