1👍
I use this in my own projects. The order_by and values make it group by name
from django.db import models
Model.objects.order_by('name').values('name').annotate(max_timestamp=models.Max("timestamp"))
Source:stackexchange.com
1👍
I use this in my own projects. The order_by and values make it group by name
from django.db import models
Model.objects.order_by('name').values('name').annotate(max_timestamp=models.Max("timestamp"))