1
0
mirror of https://github.com/django/django.git synced 2025-07-05 18:29:11 +00:00

[1.3.X] Fixed #15794 -- Corrected an error in the docs which indicated applying decorators to any of the view-like methods would work when it will only work reliably with dispatch. Thanks to carbonXT for the report and patch.

Backport of [16056] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16057 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gabriel Hurley 2011-04-20 20:04:46 +00:00
parent 24adaf76f1
commit 64995cdd63

View File

@ -585,11 +585,8 @@ Decorating the class
-------------------- --------------------
To decorate every instance of a class-based view, you need to decorate To decorate every instance of a class-based view, you need to decorate
the class definition itself. To do this you apply the decorator to one the class definition itself. To do this you apply the decorator to the
of the view-like methods on the class; that is, :meth:`~django.views.generic.base.View.dispatch` method of the class.
:meth:`~django.views.generic.base.View.dispatch`, or one of the HTTP
methods (:meth:`~django.views.generic.base.View.get`,
:meth:`~django.views.generic.base.View.post` etc).
A method on a class isn't quite the same as a standalone function, so A method on a class isn't quite the same as a standalone function, so
you can't just apply a function decorator to the method -- you need to you can't just apply a function decorator to the method -- you need to