0👍
from django.db.models import Count
result = (DailyCountsModel.objects
.values('totalPacks', 'date')
.annotate(dcount=Count('totalPacks'))
.order_by('-date')
)
Source:stackexchange.com
0👍
from django.db.models import Count
result = (DailyCountsModel.objects
.values('totalPacks', 'date')
.annotate(dcount=Count('totalPacks'))
.order_by('-date')
)