I'm wondering if there is any way to pass a list to a django queryset and limit to the max/min/latest/oldest value for each item in the list.
Basically something like this:
serial_list = [2231, 2232, 2233]
data_queryset = Data.objects.filter(serial__in=serial_list).latest()
I'm fully aware that the above code doesn't work. I'm just trying to illustrate a queryset that would return the .latest() value for each object where the serial is in serial_list.
Data.objects.filter(serial__in=serial_list).latest('date_field_name')?