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:

%7B'amount':%20Decimal('-2000.00')%7D

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,

Answers


Your loan_amount is dictionary. Just do

loan_amount = loan_amount['amount']

Need Your Help

How can json data be shown in jquery $.each

javascript php jquery json

I am using $.each loop for the json response i am getting here it is

Error when trying to use the SQLite wrapper FMDatabase

iphone ios sqlite fmdb

I'm having trouble when I try to use FMDatabase.