From 2dbd9d2690b508cb92ee360276f4d8f334488f81 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sat, 2 Dec 2023 22:08:36 +0800 Subject: [PATCH] Return equipment and equipment instances sorted by id in ascending order --- equipment_tracker/equipments/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/equipment_tracker/equipments/views.py b/equipment_tracker/equipments/views.py index a0adb45..700f6b1 100644 --- a/equipment_tracker/equipments/views.py +++ b/equipment_tracker/equipments/views.py @@ -12,7 +12,7 @@ class EquipmentViewSet(viewsets.ModelViewSet): if (not DEBUG): permission_classes = [IsAuthenticated, IsTechnician] serializer_class = serializers.EquipmentSerializer - queryset = Equipment.objects.all().order_by('-date_added') + queryset = Equipment.objects.all().order_by('id') # For viewing all logs for all equipments @@ -54,7 +54,7 @@ class EquipmentInstanceViewSet(viewsets.ModelViewSet): if (not DEBUG): permission_classes = [IsAuthenticated, IsTechnician] serializer_class = serializers.EquipmentInstanceSerializer - queryset = EquipmentInstance.objects.all().order_by('-date_added') + queryset = EquipmentInstance.objects.all().order_by('id') # For viewing all equipment instance logs