Не может умножить последовательность на неинт типа 'QuerySet'
Я только начинаю изучать django, и я хочу попросить решить мою проблему
здесь мой models.py
class LotSell(models.Model):
rate = models.DecimalField(max_digits=5, decimal_places=4)
в админке django вход со значением 0,0666 или что-то в этом роде
views.py
def result(request):
price_buyer = request.GET['price_buyer']
temp_price = LotSell.objects.values_list('rate')
tot_price = price_buyer * temp_price
data = {
'tot_price': tot_price,
}
return render(request, 'resultsell.html', data)
resultsell.html
<body>
{{tot_price}}
</body>
index.html
<form action="{% url 'resultsell %}" method="get">
{% csrf_token %}
<input type="text" name="price_buyer">
<br>
<button type="submit"> Submit</button
</form>
В итоге, я хочу показать пользователю общую цену по: ставка (вводится администратором как десятичная дробь или процент) умножить цену_покупателя, где вводится пользователем
Спасибо