I have a django model like. it stores total transactions happened over time periods.
class Transaction(models.Model):
amount = models.FloatField()
seller = models.ForeignKey(User, related_name='sells', on_delete=models.CASCADE)
buyer = models.ForeignKey(User, related_name='purchased', on_delete=models.CASCADE)
created_at_date = models.DateField(auto_now_add=True)
my question:
is that how can i find total amount of transactions for each day. for each day it should calculate Sum of all transactions in that day.
I need for example do this for last 7 days.