|
@@ -8,7 +8,7 @@
|
|
"""
|
|
"""
|
|
|
|
|
|
from django.db import transaction
|
|
from django.db import transaction
|
|
-from django.db.models import Q, Count, F
|
|
|
|
|
|
+from django.db.models import Q, Count
|
|
from django.views.generic.base import View
|
|
from django.views.generic.base import View
|
|
|
|
|
|
from Controller.SensorGateway.EquipmentFamilyController import EquipmentFamilyView
|
|
from Controller.SensorGateway.EquipmentFamilyController import EquipmentFamilyView
|
|
@@ -255,14 +255,10 @@ class GatewayFamilyRoomView(View):
|
|
'sort': []
|
|
'sort': []
|
|
}
|
|
}
|
|
try:
|
|
try:
|
|
- family_room_device_qs = FamilyRoomDevice.objects.filter(family_id=family_id).values('device_id',
|
|
|
|
- 'device__Type',
|
|
|
|
- 'device__NickName',
|
|
|
|
- 'room_id',
|
|
|
|
- 'sub_device',
|
|
|
|
- 'category',
|
|
|
|
- ).order_by(
|
|
|
|
- 'sort', '-device__data_joined')
|
|
|
|
|
|
+ family_room_device_qs = FamilyRoomDevice.objects.filter(family_id=family_id)
|
|
|
|
+ family_room_device_qs = family_room_device_qs.filter(~Q(device__isExist=2)) \
|
|
|
|
+ .values('device_id', 'device__Type', 'device__NickName', 'room_id',
|
|
|
|
+ 'sub_device', 'category', ).order_by('sort', '-device__data_joined')
|
|
|
|
|
|
if not family_room_device_qs.exists():
|
|
if not family_room_device_qs.exists():
|
|
return response.json(0, device_room)
|
|
return response.json(0, device_room)
|