Skip to content

No way to override renderer_classes for single (non-@action) method of ViewSet #9151

Closed Answered by reuben
reuben asked this question in Potential Issue
Discussion options

You must be logged in to vote

Figured it out, bit awkward but it does the trick. In the ViewSet class I override:

    def get_renderers(self):
        if self.action == 'create':
            return [RendererA(), RendererB()]
        else:
            return [RendererA()]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by reuben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant