The most important decorator in this module is `@api_view`, which is used for writing function-based views with REST framework. There are also various decorators for setting the API policies on function based views, as well as the `@action` decorator, which is used to annotate methods on viewsets that should be included by routers.
Class |
|
Enables mapping HTTP methods to different ViewSet methods for a single, logical action. |
Function | action |
Mark a ViewSet method as a routable action. |
Function | api |
Decorator that converts a function-based view into an APIView subclass. Takes a list of allowed methods for the view as an argument. |
Function | authentication |
Undocumented |
Function | parser |
Undocumented |
Function | permission |
Undocumented |
Function | renderer |
Undocumented |
Function | schema |
Undocumented |
Function | throttle |
Undocumented |
Mark a ViewSet method as a routable action. `@action`-decorated functions will be endowed with a `mapping` property, a `MethodMapper` that can be used to add additional method-based behaviors on the routed action. :param methods: A list of HTTP method names this action responds to. Defaults to GET only. :param detail: Required. Determines whether this action applies to instance/detail requests or collection/list requests. :param url_path: Define the URL segment for this action. Defaults to the name of the method decorated. :param url_name: Define the internal (`reverse`) URL name for this action. Defaults to the name of the method decorated with underscores replaced with dashes. :param kwargs: Additional properties to set on the view. This can be used to override viewset-level *_classes settings, equivalent to how the `@renderer_classes` etc. decorators work for function- based API views.