Why not ``Device.objects.filter(model__type=DeviceType.unknown) ``?