请告诉我,您如何访问GET请求中发送到以下表单的ViewSet的字段:
class MyViewSet(ReadOnlyModelViewSet):
http_method_names = ['get']
queryset = User.objects.all()
serializer_class = MySerializer
permission_classes = (AllowAny,)
def list(self, request, *args, **kwargs):
request.data # < attempt to access this attribute will return an empty dictionary
return super().list(request, args, kwargs)
答案 0 :(得分:2)