I have the following data which I want to pass to JsonResponse.
coin_amount = [Portfolio.objects.filter(user = request.user, coin = key['coin']).values('amount') for key in coin_sell_options]
print(list(coin_amount))
However this returns a ValuesQuerySet, which is not Json serializable:
[<QuerySet [{'amount': Decimal('3.0000000')}]>, <QuerySet [{'amount':
Decimal('0.1000000')}]>, <QuerySet [{'amount': Decimal('9.0000000')}]>]
That's problematic because I need a list that is JSON serializable.
So I need to get a list like this from my ValuesQuerySet somehow:
['3.0000000', '0.1000000', '9.0000000']