Get value of specific row in Django models
I'm trying to get a specific row through the get function but it returns more values than it should.
My code in view:
loan_amount = Transactions.objects.values('amount').get(amount__lt = 0, loans = l)
There will be one negative value in this table, I want that value returned. The above code returns:
This value is from the url, because I'm passing this value as parameter to another view.
I only want the -2000 value. What query option should I use?
Any help or direction would be appreciated,
Thanks in advance,
Your loan_amount is dictionary. Just do
loan_amount = loan_amount['amount']