-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderer_classes
decorator does not change rendering on view
#6748
Comments
From reading the code, I can understand that the |
Hi @PaulWay. First, "yes, it's supposed to work that way" 😄.
Do you have any specific recommendations here? The API policy decorators section demonstrates that these decorators should be used with
Adding a short blurb to the decorators might be helpful. e.g., def parser_classes(parser_classes):
"""Set the `parser_classes` for function-based API views."""
... |
The documentation already states to use the class attribute:
and only mention the decorator for the function based views. |
This is kind of unfortunate though – I have a viewset that has a default set of permission/throttling classes, which I'd need to override for a handful of I read the same documentation, but it also says "for an individual view", which led me to think things'd work with "individual views" such as I'd suggest either
|
@akx |
@xordoquy Thanks! It seems That does seem to be documented within the prose docs but not within the docstring (which is where I tend to look first since it's more easily at hand). Time for a PR to improve that... |
Checklist
master
branch of Django REST framework.Steps to reproduce
renderer_classes
property.renderer_classes
decorator asrenderer_classes_decorator
.Expected behavior
The decorated view should have a different set of renderer classes.
Actual behavior
The decorated view has the same set of renderer classes as the rest of the viewset.
The text was updated successfully, but these errors were encountered: