summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/class-based-views.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt
index 516a3150ed..7446f6ab92 100644
--- a/docs/topics/class-based-views.txt
+++ b/docs/topics/class-based-views.txt
@@ -605,8 +605,15 @@ that it can be used on an instance method. For example::
template_name = 'secret.html'
@method_decorator(login_required)
- def dispatch(self, **kwargs):
+ def dispatch(self, *args, **kwargs):
return super(ProtectedView, self).dispatch(**kwargs)
-In this example, every instance of :class:`ProtectedView` will have
+In this example, every instance of ``ProtectedView`` will have
login protection.
+
+.. note::
+
+ ``method_decorator`` passes ``*args`` and ``**kwargs``
+ as parameters to the decorated method on the class. If your method
+ does not accept a compatible set of parameters it will raise a
+ ``TypeError`` exception. \ No newline at end of file