Explorar o código

增加排序字段

peng %!s(int64=3) %!d(string=hai) anos
pai
achega
68bd41c308
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Controller/SensorGateway/GatewayFamilyRoomController.py

+ 1 - 1
Controller/SensorGateway/GatewayFamilyRoomController.py

@@ -214,7 +214,7 @@ class GatewayFamilyRoomView(View):
         try:
             family_room_device_qs = FamilyRoomDevice.objects.filter(family_id=family_id, sub_device=0). \
                 annotate(type=F('device__Type'), nickname=F('device__NickName')). \
-                values('device_id', 'type', 'nickname', 'room_id').order_by('sort')
+                values('device_id', 'type', 'nickname', 'room_id', 'sort').order_by('sort')
             if not family_room_device_qs.exists():
                 return response.json(0, [])