diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/5.0.txt | 4 | ||||
| -rw-r--r-- | docs/topics/async.txt | 25 | ||||
| -rw-r--r-- | docs/topics/http/decorators.txt | 8 |
3 files changed, 36 insertions, 1 deletions
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt index 3a4355588b..48df713375 100644 --- a/docs/releases/5.0.txt +++ b/docs/releases/5.0.txt @@ -214,7 +214,9 @@ CSRF Decorators ~~~~~~~~~~ -* ... +* The :func:`~django.views.decorators.cache.cache_control` and + :func:`~django.views.decorators.cache.never_cache` decorators now support + wrapping asynchronous view functions. Email ~~~~~ diff --git a/docs/topics/async.txt b/docs/topics/async.txt index 4b667f22a1..769fac3c52 100644 --- a/docs/topics/async.txt +++ b/docs/topics/async.txt @@ -73,6 +73,31 @@ from an async view, you will trigger Django's :ref:`asynchronous safety protection <async-safety>` to protect your data from corruption. +Decorators +---------- + +.. versionadded:: 5.0 + +The following decorators can be used with both synchronous and asynchronous +view functions: + +* :func:`~django.views.decorators.cache.cache_control` +* :func:`~django.views.decorators.cache.never_cache` + +For example:: + + from django.views.decorators.cache import never_cache + + + @never_cache + def my_sync_view(request): + ... + + + @never_cache + async def my_async_view(request): + ... + Queries & the ORM ----------------- diff --git a/docs/topics/http/decorators.txt b/docs/topics/http/decorators.txt index 3481eefb3c..4bcae64e27 100644 --- a/docs/topics/http/decorators.txt +++ b/docs/topics/http/decorators.txt @@ -117,6 +117,10 @@ client-side caching. :func:`~django.utils.cache.patch_cache_control` for the details of the transformation. + .. versionchanged:: 5.0 + + Support for wrapping asynchronous view functions was added. + .. function:: never_cache(view_func) This decorator adds an ``Expires`` header to the current date/time. @@ -127,6 +131,10 @@ client-side caching. Each header is only added if it isn't already set. + .. versionchanged:: 5.0 + + Support for wrapping asynchronous view functions was added. + .. module:: django.views.decorators.common Common |
