Browse Source

Fixed #30161 -- Added how to decorate class-based views to view decorators docs.

alexanderblnf 6 years ago
parent
commit
406de977ea
2 changed files with 6 additions and 0 deletions
  1. 3 0
      docs/topics/class-based-views/intro.txt
  2. 3 0
      docs/topics/http/decorators.txt

+ 3 - 0
docs/topics/class-based-views/intro.txt

@@ -307,6 +307,9 @@ decorator. In the example, ``never_cache()`` will process the request before
 ``login_required()``.
 
 In this example, every instance of ``ProtectedView`` will have login protection.
+These examples use ``login_required``, however, the same behavior can be
+obtained more simply using
+:class:`~django.contrib.auth.mixins.LoginRequiredMixin`.
 
 .. note::
 

+ 3 - 0
docs/topics/http/decorators.txt

@@ -7,6 +7,9 @@ View decorators
 Django provides several decorators that can be applied to views to support
 various HTTP features.
 
+See :ref:`decorating-class-based-views` for how to use these decorators with
+class-based views.
+
 Allowed HTTP methods
 ====================