1👍
✅
distinct accepts an argument of what fields to operate on, so probably you want:
daily_count = ShipmentSubSortScanMapping.objects.all().distinct('shipment_id')
👤DRC
Source:stackexchange.com