I have the following queryset
qs = Model.objects.\
filter(user_id=request.user.pk).\
only('item_id', 'action', 'performed_at').\
order_by().\
order_by('performed_at')
This queryset will fetch some duplicate Models but with different performed_at
and with same item_id
. What I want is to keep most recent occurrence by item_id
keeping the order_by and without evaluating the queryset.