I have two models like this:
class ItemType(models.Model):
type = models.CharField(max_length=100)
class Items(models.Model):
item_type = models.ForeignKey(ItemType, on_delete=models.CASCADE)
item_amount = models.FloatField()
now I want to get sum of item_amount according to item_type. How I can do this?