diff options
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 |
