Author: timo Date: 2012-02-20 10:58:34 -0800 (Mon, 20 Feb 2012) New Revision: 17565
Modified: django/branches/releases/1.3.X/docs/topics/auth.txt django/branches/releases/1.3.X/docs/topics/class-based-views.txt Log: [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. Modified: django/branches/releases/1.3.X/docs/topics/auth.txt =================================================================== --- django/branches/releases/1.3.X/docs/topics/auth.txt 2012-02-20 18:57:51 UTC (rev 17564) +++ django/branches/releases/1.3.X/docs/topics/auth.txt 2012-02-20 18:58:34 UTC (rev 17565) @@ -1174,10 +1174,17 @@ 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 @login_required Modified: django/branches/releases/1.3.X/docs/topics/class-based-views.txt =================================================================== --- django/branches/releases/1.3.X/docs/topics/class-based-views.txt 2012-02-20 18:57:51 UTC (rev 17564) +++ django/branches/releases/1.3.X/docs/topics/class-based-views.txt 2012-02-20 18:58:34 UTC (rev 17565) @@ -584,6 +584,8 @@ want every instance of a view to be decorated, you need to take a different approach. +.. _decorating-class-based-views: + Decorating the class -------------------- -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.