1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

created a ref to class-based views and updated docs links to point to the ref

This commit is contained in:
mbcodes 2024-10-30 19:37:46 -07:00
parent 6049f1628b
commit f1c0936af0
9 changed files with 12 additions and 16 deletions

View File

@ -18,7 +18,7 @@ Glossary
A higher-order :term:`view` function that provides an abstract/generic A higher-order :term:`view` function that provides an abstract/generic
implementation of a common idiom or pattern found in view development. implementation of a common idiom or pattern found in view development.
See :doc:`/topics/class-based-views/index`. See :ref:`class-based-views-explanation`.
model model
Models store your application's data. Models store your application's data.

View File

@ -1230,8 +1230,7 @@ details on these changes.
instead use ``django.contrib.formtools.utils.form_hmac`` instead use ``django.contrib.formtools.utils.form_hmac``
* The function-based generic view modules will be removed in favor of their * The function-based generic view modules will be removed in favor of their
class-based equivalents, outlined in :doc:`class-based views class-based equivalents, outlined in :ref:`class-based-views-explanation`.
</topics/class-based-views/index>`.
* The ``django.core.servers.basehttp.AdminMediaHandler`` will be * The ``django.core.servers.basehttp.AdminMediaHandler`` will be
removed. In its place use removed. In its place use

View File

@ -340,8 +340,7 @@ use the variable you want.
Run the server, and use your new polling app based on generic views. Run the server, and use your new polling app based on generic views.
For full details on generic views, see the :doc:`generic views documentation For full details on generic views, see the generic views documentation under :ref:`class-based-views-explanation`.
</topics/class-based-views/index>`.
When you're comfortable with forms and generic views, read :doc:`part 5 of this When you're comfortable with forms and generic views, read :doc:`part 5 of this
tutorial</intro/tutorial05>` to learn about testing our polls app. tutorial</intro/tutorial05>` to learn about testing our polls app.

View File

@ -3,7 +3,7 @@ Built-in class-based views API
============================== ==============================
Class-based views API reference. For introductory material, see the Class-based views API reference. For introductory material, see the
:doc:`/topics/class-based-views/index` topic guide. :ref:`class-based-views-explanation` topic guide.
.. toctree:: .. toctree::
:maxdepth: 3 :maxdepth: 3

View File

@ -69,9 +69,7 @@ provided, along with a completely generic view base class that can be
used as the basis for reusable applications that can be easily used as the basis for reusable applications that can be easily
extended. extended.
See :doc:`the documentation on class-based generic views</topics/class-based-views/index>` See the documentation on :ref:`class-based-views-explanation` for more details. There is also a document to help you `convert your function-based generic views to class-based
for more details. There is also a document to help you `convert
your function-based generic views to class-based
views <https://raw.githubusercontent.com/django/django/ea9dc9f4b03ae034c1dc080730422dda7a9c2e47/docs/topics/generic-views-migration.txt>`_. views <https://raw.githubusercontent.com/django/django/ea9dc9f4b03ae034c1dc080730422dda7a9c2e47/docs/topics/generic-views-migration.txt>`_.
Logging Logging

View File

@ -210,7 +210,7 @@ associated with proxy models.
New ``view`` variable in class-based views context New ``view`` variable in class-based views context
-------------------------------------------------- --------------------------------------------------
In all :doc:`generic class-based views </topics/class-based-views/index>` In all generic :ref:`class-based-views-explanation`
(or any class-based view inheriting from ``ContextMixin``), the context dictionary (or any class-based view inheriting from ``ContextMixin``), the context dictionary
contains a ``view`` variable that points to the ``View`` instance. contains a ``view`` variable that points to the ``View`` instance.

View File

@ -610,7 +610,7 @@ The ``login_required`` decorator
The ``LoginRequiredMixin`` mixin The ``LoginRequiredMixin`` mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When using :doc:`class-based views </topics/class-based-views/index>`, you can When using :ref:`class-based-views-explanation`, you can
achieve the same behavior as with ``login_required`` by using the achieve the same behavior as with ``login_required`` by using the
``LoginRequiredMixin``. This mixin should be at the leftmost position in the ``LoginRequiredMixin``. This mixin should be at the leftmost position in the
inheritance list. inheritance list.
@ -728,7 +728,7 @@ email in the desired domain and if not, redirects to the login page::
.. class:: UserPassesTestMixin .. class:: UserPassesTestMixin
When using :doc:`class-based views </topics/class-based-views/index>`, you When using :ref:`classed-based views class-based-views-explanation`, you
can use the ``UserPassesTestMixin`` to do this. can use the ``UserPassesTestMixin`` to do this.
.. method:: test_func() .. method:: test_func()
@ -1057,8 +1057,7 @@ arguments in the URLconf, these will be passed on to the view. For example::
), ),
] ]
All views are :doc:`class-based </topics/class-based-views/index>`, which allows All views are :ref:`class-based-views-explanation`, which allows you to easily customize them by subclassing.
you to easily customize them by subclassing.
.. _all-authentication-views: .. _all-authentication-views:

View File

@ -1,3 +1,5 @@
.. _class-based-views-explanation:
================= =================
Class-based views Class-based views
================= =================

View File

@ -49,8 +49,7 @@ algorithm the system follows to determine which Python code to execute:
:attr:`~django.http.HttpRequest.path_info`. :attr:`~django.http.HttpRequest.path_info`.
#. Once one of the URL patterns matches, Django imports and calls the given #. Once one of the URL patterns matches, Django imports and calls the given
view, which is a Python function (or a :doc:`class-based view view, which is a Python function (or a :ref:`class-based-views-explanation`). The view gets passed the following
</topics/class-based-views/index>`). The view gets passed the following
arguments: arguments:
* An instance of :class:`~django.http.HttpRequest`. * An instance of :class:`~django.http.HttpRequest`.