I want to list the most amounts of field of a model for each day for example this be my model:
class Topic(Model.models):
title = models.Charfield(max_lenth=40)
total_responses = models.PositiveIntegerField()
date = models.DateTimeField(add_now=True)
I have imported Max before in my views.py and this is my query set:
query = Topic.objects.values(
'date','total_responses',
).order_by('-date').aggregate(Max('total_responses'))
I am sending this query to template but it returns all models! but I just need the max amount of each day model