标签:for view turn any request *args cts res **kwargs
class ResourceSetView(viewsets.ModelViewSet):
queryset = models.Resources.objects.all()
serializer_class = serializers.ResourceSerializer
def list(self, request, *args, **kwargs):
queryset = models.Resources.objects.all() # import
serializer = serializers.ResourceSerializer(queryset, many=True)
return Response({‘data‘: serializer.data})
django rest framework custom json format
标签:for view turn any request *args cts res **kwargs
原文地址:https://www.cnblogs.com/otfsenter/p/9606629.html