Equipment.objects.all()
total = Equipment.objects.aggregate(price_sum=Sum('price'))
total_price = total['price_sum']
Django newbie here. I have a decimal varible called total_price. What I want to do is multiply the value by a VAT value. Now I already have a VAT field already in my models which can store a VAT. I want to be able to multiply that VAT field with total_price. With the vat field, its job is just to store one vat value.
class Equipment(models.Model):
price = models.DecimalField(max_digits = 12, decimal_places=2)
vat = models.ForeignKey(VAT)