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:
@@ -161,8 +161,8 @@ The :meth:`~django.db.models.query.QuerySet.count` function respects
|
||||
>>> Article.objects.filter(publications__in=[p1, p2]).distinct()
|
||||
<QuerySet [<Article: Django lets you build web apps easily>, <Article: NASA uses Python>]>
|
||||
|
||||
Reverse m2m queries are supported (i.e., starting at the table that doesn't have
|
||||
a :class:`~django.db.models.ManyToManyField`):
|
||||
Reverse m2m queries are supported (i.e., starting at the table that doesn't
|
||||
have a :class:`~django.db.models.ManyToManyField`):
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
Many-to-one relationships
|
||||
=========================
|
||||
|
||||
To define a many-to-one relationship, use :class:`~django.db.models.ForeignKey`.
|
||||
To define a many-to-one relationship, use
|
||||
:class:`~django.db.models.ForeignKey`.
|
||||
|
||||
In this example, a ``Reporter`` can be associated with many ``Article``
|
||||
objects, but an ``Article`` can only have one ``Reporter`` object::
|
||||
@@ -229,8 +230,8 @@ Queries can go round in circles:
|
||||
<QuerySet [<Reporter: John Smith>]>
|
||||
|
||||
If you delete a reporter, their articles will be deleted (assuming that the
|
||||
ForeignKey was defined with :attr:`django.db.models.ForeignKey.on_delete` set to
|
||||
``CASCADE``, which is the default):
|
||||
ForeignKey was defined with :attr:`django.db.models.ForeignKey.on_delete` set
|
||||
to ``CASCADE``, which is the default):
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ Restaurants:
|
||||
>>> Place.objects.order_by("name")
|
||||
<QuerySet [<Place: Ace Hardware the place>, <Place: Demon Dogs the place>]>
|
||||
|
||||
You can query the models using :ref:`lookups across relationships <lookups-that-span-relationships>`:
|
||||
You can query the models using :ref:`lookups across relationships
|
||||
<lookups-that-span-relationships>`:
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user