Order by id available equipments

This commit is contained in:
Keannu Bernasol 2024-01-07 11:54:38 +08:00
parent c61f978c75
commit 8e43e06ec2

View file

@ -103,7 +103,8 @@ class AvailableEquipmentInstanceViewSet(generics.ListAPIView):
# Get all equipment instances which are not associated with non-finalized transactions # Get all equipment instances which are not associated with non-finalized transactions
queryset = EquipmentInstance.objects.exclude( queryset = EquipmentInstance.objects.exclude(
id__in=non_finalized_equipments.values_list('id', flat=True) id__in=non_finalized_equipments.values_list(
'id', flat=True).order_by('id')
) )
cache.set(key, queryset, timeout=60*60*24) cache.set(key, queryset, timeout=60*60*24)