

def transactions_as_csv(target, portfolio):
    writer = csv.writer(target)
    writer.writerow(FRANO_TRANSACTION_EXPORT_HEADER)
    transactions = Transaction.objects.filter(portfolio__id__exact=portfolio.id).order_by('-as_of_date', '-id')
    for transaction in transactions:
        writer.writerow([transaction.as_of_date.strftime('%m/%d/%Y'), transaction.type, transaction.symbol, transaction.quantity, target.price, transaction.total, transaction.linked_symbol])

dataset/ETHPy150Open fxdemolisher/frano/frano/transactions/models.py transactions_as_csv/VarMisuse@83/116 `transaction`->`target`