From 712256829ad9cc31c2dd04e3e3656426cff9444d Mon Sep 17 00:00:00 2001 From: qqii Date: Mon, 11 Aug 2025 18:21:11 +0100 Subject: [PATCH] Add docs for new decorators --- docs/api-guide/views.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/api-guide/views.md b/docs/api-guide/views.md index b293de75a..05a35c3d6 100644 --- a/docs/api-guide/views.md +++ b/docs/api-guide/views.md @@ -186,8 +186,13 @@ The available decorators are: * `@authentication_classes(...)` * `@throttle_classes(...)` * `@permission_classes(...)` +* `@content_negotiation_class(...)` +* `@metadata_class(...)` +* `@versioning_class(...)` -Each of these decorators takes a single argument which must be a list or tuple of classes. +Each of these decorators is equivalent to setting their respective [api policy attributes][api-policy-attributes]. + +All decorators take a single argument. The ones that end with `_class` expect a single class while the ones ending in `_classes` expect a list or tuple of classes. ## View schema decorator @@ -224,4 +229,5 @@ You may pass `None` in order to exclude the view from schema generation. [throttling]: throttling.md [schemas]: schemas.md [classy-drf]: http://www.cdrf.co +[api-policy-attributes]: views.md#api-policy-attributes