diff options
| author | Rigel Di Scala <rigel.discala@propylon.com> | 2015-07-21 21:54:37 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-08-01 08:38:03 -0400 |
| commit | 3bdaaf6777804d33ee46cdb5a889b8cc544a91f1 (patch) | |
| tree | 86399ce870c06f59584c98bc3988d9ed8c739c87 /docs/ref | |
| parent | 1a76257b1b385ac8afd67bd36d061f508613e4d2 (diff) | |
Fixed #25146 -- Allowed method_decorator() to decorate classes.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/utils.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index c9deba887a..12bb351df0 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -151,11 +151,17 @@ The functions defined in this module share the following properties: .. module:: django.utils.decorators :synopsis: Functions that help with creating decorators for views. -.. function:: method_decorator(decorator) +.. function:: method_decorator(decorator, name='') - Converts a function decorator into a method decorator. See :ref:`decorating + Converts a function decorator into a method decorator. It can be used to + decorate methods or classes; in the latter case, ``name`` is the name + of the method to be decorated and is required. See :ref:`decorating class based views<decorating-class-based-views>` for example usage. + .. versionchanged:: 1.9 + + The ability to decorate classes and the ``name`` parameter were added. + .. function:: decorator_from_middleware(middleware_class) Given a middleware class, returns a view decorator. This lets you use |
