diff --git a/equipment_tracker/equipments/views.py b/equipment_tracker/equipments/views.py index d1a03a7..e9f20d9 100644 --- a/equipment_tracker/equipments/views.py +++ b/equipment_tracker/equipments/views.py @@ -103,7 +103,8 @@ class AvailableEquipmentInstanceViewSet(generics.ListAPIView): # Get all equipment instances which are not associated with non-finalized transactions 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)