mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #36485 -- Rewrapped docs to 79 columns line length.
Lines in the docs files were manually adjusted to conform to the 79 columns limit per line (plus newline), improving readability and consistency across the content.
This commit is contained in:
@@ -10,8 +10,8 @@ views.
|
||||
|
||||
Many of Django's built-in class-based views inherit from other class-based
|
||||
views or various mixins. Because this inheritance chain is very important, the
|
||||
ancestor classes are documented under the section title of **Ancestors (MRO)**.
|
||||
MRO is an acronym for Method Resolution Order.
|
||||
ancestor classes are documented under the section title of **Ancestors
|
||||
(MRO)**. MRO is an acronym for Method Resolution Order.
|
||||
|
||||
``View``
|
||||
========
|
||||
@@ -103,9 +103,9 @@ MRO is an acronym for Method Resolution Order.
|
||||
delegate to a method that matches the HTTP method; a ``GET`` will be
|
||||
delegated to ``get()``, a ``POST`` to ``post()``, and so on.
|
||||
|
||||
By default, a ``HEAD`` request will be delegated to ``get()``.
|
||||
If you need to handle ``HEAD`` requests in a different way than ``GET``,
|
||||
you can override the ``head()`` method. See
|
||||
By default, a ``HEAD`` request will be delegated to ``get()``. If you
|
||||
need to handle ``HEAD`` requests in a different way than ``GET``, you
|
||||
can override the ``head()`` method. See
|
||||
:ref:`supporting-other-http-methods` for an example.
|
||||
|
||||
.. method:: http_method_not_allowed(request, *args, **kwargs)
|
||||
|
||||
@@ -222,9 +222,9 @@ views for displaying drilldown pages for date-based data.
|
||||
context will be:
|
||||
|
||||
* ``date_list``: A :meth:`QuerySet <django.db.models.query.QuerySet.dates>`
|
||||
object containing all days that have objects available in the given month,
|
||||
according to ``queryset``, represented as :class:`datetime.datetime`
|
||||
objects, in ascending order.
|
||||
object containing all days that have objects available in the given
|
||||
month, according to ``queryset``, represented as
|
||||
:class:`datetime.datetime` objects, in ascending order.
|
||||
|
||||
* ``month``: A :class:`~datetime.date` object
|
||||
representing the given month.
|
||||
|
||||
@@ -78,8 +78,9 @@ Multiple object mixins
|
||||
|
||||
.. attribute:: ordering
|
||||
|
||||
A string or list of strings specifying the ordering to apply to the ``queryset``.
|
||||
Valid values are the same as those for :meth:`~django.db.models.query.QuerySet.order_by`.
|
||||
A string or list of strings specifying the ordering to apply to the
|
||||
``queryset``. Valid values are the same as those for
|
||||
:meth:`~django.db.models.query.QuerySet.order_by`.
|
||||
|
||||
.. attribute:: paginate_by
|
||||
|
||||
@@ -106,10 +107,10 @@ Multiple object mixins
|
||||
.. attribute:: paginator_class
|
||||
|
||||
The paginator class to be used for pagination. By default,
|
||||
:class:`django.core.paginator.Paginator` is used. If the custom paginator
|
||||
class doesn't have the same constructor interface as
|
||||
:class:`django.core.paginator.Paginator`, you will also need to
|
||||
provide an implementation for :meth:`get_paginator`.
|
||||
:class:`django.core.paginator.Paginator` is used. If the custom
|
||||
paginator class doesn't have the same constructor interface as
|
||||
:class:`django.core.paginator.Paginator`, you will also need to provide
|
||||
an implementation for :meth:`get_paginator`.
|
||||
|
||||
.. attribute:: context_object_name
|
||||
|
||||
@@ -122,8 +123,8 @@ Multiple object mixins
|
||||
|
||||
.. method:: get_ordering()
|
||||
|
||||
Returns a string (or iterable of strings) that defines the ordering that
|
||||
will be applied to the ``queryset``.
|
||||
Returns a string (or iterable of strings) that defines the ordering
|
||||
that will be applied to the ``queryset``.
|
||||
|
||||
Returns :attr:`ordering` by default.
|
||||
|
||||
@@ -132,10 +133,10 @@ Multiple object mixins
|
||||
Returns a 4-tuple containing (``paginator``, ``page``, ``object_list``,
|
||||
``is_paginated``).
|
||||
|
||||
Constructed by paginating ``queryset`` into pages of size ``page_size``.
|
||||
If the request contains a ``page`` argument, either as a captured URL
|
||||
argument or as a GET argument, ``object_list`` will correspond to the
|
||||
objects from that page.
|
||||
Constructed by paginating ``queryset`` into pages of size
|
||||
``page_size``. If the request contains a ``page`` argument, either as a
|
||||
captured URL argument or as a GET argument, ``object_list`` will
|
||||
correspond to the objects from that page.
|
||||
|
||||
.. method:: get_paginate_by(queryset)
|
||||
|
||||
|
||||
@@ -102,9 +102,10 @@ Single object mixins
|
||||
|
||||
Returns context data for displaying the object.
|
||||
|
||||
The base implementation of this method requires that the ``self.object``
|
||||
attribute be set by the view (even if ``None``). Be sure to do this if
|
||||
you are using this mixin without one of the built-in views that does so.
|
||||
The base implementation of this method requires that the
|
||||
``self.object`` attribute be set by the view (even if ``None``). Be
|
||||
sure to do this if you are using this mixin without one of the built-in
|
||||
views that does so.
|
||||
|
||||
It returns a dictionary with these contents:
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
Class-based views mixins
|
||||
========================
|
||||
|
||||
Class-based views API reference. For introductory material, see :doc:`/topics/class-based-views/mixins`.
|
||||
Class-based views API reference. For introductory material, see
|
||||
:doc:`/topics/class-based-views/mixins`.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
Reference in New Issue
Block a user