请告诉我,如何将GET请求中发送的字段访问到以下表单的视图集:
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)
根据文档,您应该使用
.query_params
更多详细信息query_params
相关问题 更多 >
编程相关推荐