コード例 #1
0
 def retrieve(self, _request, pk=None):
     """Handle retrieve requests"""
     for checker in load_checker_classes():
         if checker.get_type() == pk:
             serializer = serializers.ServiceHandlerSerializer(
                 self._build_object(checker))
             return Response(serializer.data)
コード例 #2
0
 def list(self, _request):
     """Handle list requests"""
     queryset = [self._build_object(c) for c in load_checker_classes()]
     serializer = serializers.ServiceHandlerSerializer(queryset, many=True)
     return Response(serializer.data)