Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15328 -- Corrected an example in the CBV docs and added a note…

… about the parameters passed by method_deorator to the method on the class. Thanks to airstrike for the report and lrekucki for the correction.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e06dfda91862d8c5015b0036c59d829359ed7f7b 1 parent fe11100
authored February 18, 2011

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. 11  docs/topics/class-based-views.txt
11  docs/topics/class-based-views.txt
@@ -605,8 +605,15 @@ that it can be used on an instance method. For example::
605 605
         template_name = 'secret.html'
606 606
 
607 607
         @method_decorator(login_required)
608  
-        def dispatch(self, **kwargs):
  608
+        def dispatch(self, *args, **kwargs):
609 609
             return super(ProtectedView, self).dispatch(**kwargs)
610 610
 
611  
-In this example, every instance of :class:`ProtectedView` will have
  611
+In this example, every instance of ``ProtectedView`` will have
612 612
 login protection.
  613
+
  614
+.. note::
  615
+
  616
+    ``method_decorator`` passes ``*args`` and ``**kwargs``
  617
+    as parameters to the decorated method on the class. If your method
  618
+    does not accept a compatible set of parameters it will raise a
  619
+    ``TypeError`` exception.

0 notes on commit e06dfda

Please sign in to comment.
Something went wrong with that request. Please try again.