Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.3.X] Fixed #17390 - Added a note to topics/auth.txt regarding how …

…to decorate class-based generic views; thanks zsiciarz for the patch.

Backport of r17564 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@17565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4f6c36435cb3a083c25c040c278ef89a70810f16 1 parent 4d95968
Tim Graham authored February 20, 2012
13  docs/topics/auth.txt
@@ -1174,9 +1174,16 @@ The permission_required decorator
1174 1174
 Limiting access to generic views
1175 1175
 --------------------------------
1176 1176
 
1177  
-To limit access to a :doc:`generic view </ref/generic-views>`, write a thin
1178  
-wrapper around the view, and point your URLconf to your wrapper instead of the
1179  
-generic view itself. For example::
  1177
+Controlling access to a :doc:`class-based generic view </ref/class-based-views>`
  1178
+is done by decorating the :meth:`View.dispatch <django.views.generic.base.View.dispatch>`
  1179
+method on the class. See :ref:`decorating-class-based-views` for the details.
  1180
+
  1181
+Function-based generic views
  1182
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1183
+
  1184
+To limit access to a :doc:`function-based generic view </ref/generic-views>`,
  1185
+write a thin wrapper around the view, and point your URLconf to your wrapper
  1186
+instead of the generic view itself. For example::
1180 1187
 
1181 1188
     from django.views.generic.date_based import object_detail
1182 1189
 
2  docs/topics/class-based-views.txt
@@ -584,6 +584,8 @@ This approach applies the decorator on a per-instance basis. If you
584 584
 want every instance of a view to be decorated, you need to take a
585 585
 different approach.
586 586
 
  587
+.. _decorating-class-based-views:
  588
+
587 589
 Decorating the class
588 590
 --------------------
589 591
 

0 notes on commit 4f6c364

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