def get_serializer_class(self):
    if (self.action in ['list']):
        return DeviceListSerializer
    return DeviceSerializer
def get_serializer_class(self):
    if (self.action in ['list']):
        return DeviceListSerializer
    return DeviceSerializer