阅读背景:

将请求上下文从Django Rest框架中的Viewset传递给序列化器

来源:互联网 

I have a case where the values for a serializer field depend on the identity of the currently logged in user. I have seen how to add the user to the context when initializing a serializer, but I am not sure how to do this when using a ViewSet, as you only supply the serializer class and not the actual serializer instance.I have a case where the values for a serializer




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: