def get_queryset(self): visible = filter_device_types(AnonymousUser()) return ( Device.objects.select_related("device_type") .order_by("hostname") .filter(device_type__in=visible) )
def get_queryset(self): visible = filter_device_types(None) return Device.objects.select_related("device_type")\ .order_by("hostname").filter(device_type__in=visible)
def get_queryset(self): visible = filter_device_types(AnonymousUser()) return Device.objects.select_related("device_type")\ .order_by("hostname").filter(device_type__in=visible)
def get_queryset(self): visible = filter_device_types(self.request.user) query = Device.objects.filter(device_type__in=visible) if not self.request.query_params.get("all", False): query = query.exclude(health=Device.HEALTH_RETIRED) return query
def get_queryset(self): visible = filter_device_types(self.request.user) return DeviceType.objects.filter(name__in=visible)