summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTimo Graham <timograham@gmail.com>2012-02-20 18:58:34 +0000
committerTimo Graham <timograham@gmail.com>2012-02-20 18:58:34 +0000
commit4f6c36435cb3a083c25c040c278ef89a70810f16 (patch)
treec68a2547f9951806c27a95f0f53726d35de96d62 /docs
parent4d959686e66feac9871304be80945270ccc3742d (diff)
downloaddjango-4f6c36435cb3a083c25c040c278ef89a70810f16.tar.gz
[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
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/auth.txt13
-rw-r--r--docs/topics/class-based-views.txt2
2 files changed, 12 insertions, 3 deletions
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index 5a2608a3a7..bb7bf4b07a 100644
--- a/docs/topics/auth.txt
+++ b/docs/topics/auth.txt
@@ -1174,9 +1174,16 @@ The permission_required decorator
Limiting access to generic views
--------------------------------
-To limit access to a :doc:`generic view </ref/generic-views>`, write a thin
-wrapper around the view, and point your URLconf to your wrapper instead of the
-generic view itself. For example::
+Controlling access to a :doc:`class-based generic view </ref/class-based-views>`
+is done by decorating the :meth:`View.dispatch <django.views.generic.base.View.dispatch>`
+method on the class. See :ref:`decorating-class-based-views` for the details.
+
+Function-based generic views
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To limit access to a :doc:`function-based generic view </ref/generic-views>`,
+write a thin wrapper around the view, and point your URLconf to your wrapper
+instead of the generic view itself. For example::
from django.views.generic.date_based import object_detail
diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt
index 4da48ec288..1faa98023b 100644
--- a/docs/topics/class-based-views.txt
+++ b/docs/topics/class-based-views.txt
@@ -584,6 +584,8 @@ This approach applies the decorator on a per-instance basis. If you
want every instance of a view to be decorated, you need to take a
different approach.
+.. _decorating-class-based-views:
+
Decorating the class
--------------------