Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17390 - Added a note to topics/auth.txt regarding how to decor…

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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9e62428c2814358350ae715f0d51b4c7d4f258a0 1 parent e1bbf3b
Tim Graham authored February 20, 2012
13  docs/topics/auth.txt
@@ -1457,9 +1457,16 @@ The permission_required decorator
1457 1457
 Limiting access to generic views
1458 1458
 --------------------------------
1459 1459
 
1460  
-To limit access to a :doc:`generic view </ref/generic-views>`, write a thin
1461  
-wrapper around the view, and point your URLconf to your wrapper instead of the
1462  
-generic view itself. For example::
  1460
+Controlling access to a :doc:`class-based generic view </ref/class-based-views>`
  1461
+is done by decorating the :meth:`View.dispatch <django.views.generic.base.View.dispatch>`
  1462
+method on the class. See :ref:`decorating-class-based-views` for the details.
  1463
+
  1464
+Function-based generic views
  1465
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1466
+
  1467
+To limit access to a :doc:`function-based generic view </ref/generic-views>`,
  1468
+write a thin wrapper around the view, and point your URLconf to your wrapper
  1469
+instead of the generic view itself. For example::
1463 1470
 
1464 1471
     from django.views.generic.date_based import object_detail
1465 1472
 
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 9e62428

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