Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ref/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ The Django wrappers for database exceptions behave exactly the same as
the underlying database exceptions. See :pep:`249`, the Python Database API
Specification v2.0, for further information.

As per :pep:`3134`, a ``__cause__`` attribute is set with the original
(underlying) database exception, allowing access to any additional
information provided.
A :attr:`~BaseException.__cause__` attribute is set with the original
(underlying) database exception, allowing access to any additional information
provided.

.. exception:: models.ProtectedError

Expand Down
2 changes: 1 addition & 1 deletion docs/ref/files/uploads.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Here are some useful attributes of ``UploadedFile``:
for line in uploadedfile:
do_something_with(line)

Lines are split using :pep:`universal newlines <278>`. The following are
Lines are split using :term:`python:universal newlines`. The following are
recognized as ending a line: the Unix end-of-line convention ``'\n'``, the
Windows convention ``'\r\n'``, and the old Macintosh convention ``'\r'``.

Expand Down
6 changes: 3 additions & 3 deletions docs/ref/models/querysets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2637,9 +2637,9 @@ If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary.

*Asynchronous version*: ``aiterator()``

Evaluates the ``QuerySet`` (by performing the query) and returns an iterator
(see :pep:`234`) over the results, or an asynchronous iterator (see :pep:`492`)
if you call its asynchronous version ``aiterator``.
Evaluates the ``QuerySet`` (by performing the query) and returns an
:term:`python:iterator` over the results, or an :term:`python:asynchronous
iterator` if you call its asynchronous version ``aiterator``.

A ``QuerySet`` typically caches its results internally so that repeated
evaluations do not result in additional queries. In contrast, ``iterator()``
Expand Down
5 changes: 2 additions & 3 deletions docs/topics/testing/tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ Overriding settings

For testing purposes it's often useful to change a setting temporarily and
revert to the original value after running the testing code. For this use case
Django provides a standard Python context manager (see :pep:`343`) called
Django provides a standard :ref:`context manager <context-managers>` called
:meth:`~django.test.SimpleTestCase.settings`, which can be used like this::

from django.test import TestCase
Expand Down Expand Up @@ -1390,8 +1390,7 @@ neither does ``remove`` when the value doesn't exist.
.. function:: override_settings(**kwargs)

In case you want to override a setting for a test method, Django provides the
:func:`~django.test.override_settings` decorator (see :pep:`318`). It's used
like this::
:func:`~django.test.override_settings` :term:`python:decorator`::

from django.test import TestCase, override_settings

Expand Down
4 changes: 2 additions & 2 deletions tests/model_formsets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@ def test_custom_pk(self):
'<p><label for="id_form-0-owner">Owner:</label>'
'<select name="form-0-owner" id="id_form-0-owner">'
'<option value="" selected>- Select an option -</option>'
'<option value="%d">Joe Perry at Giordanos</option>'
'<option value="%d">Jack Berry at Giordanos</option>'
'<option value="%s">Joe Perry at Giordanos</option>'
'<option value="%s">Jack Berry at Giordanos</option>'
"</select></p>"
'<p><label for="id_form-0-age">Age:</label>'
'<input type="number" name="form-0-age" id="id_form-0-age" min="0"></p>'
Expand Down
2 changes: 1 addition & 1 deletion tests/modeladmin/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class ConcertAdminWithForm(ModelAdmin):
'<select data-context="available-source" '
'name="main_band" id="id_main_band" required>'
'<option value="" selected>- Select an option -</option>'
'<option value="%d">The Doors</option>'
'<option value="%s">The Doors</option>'
"</select></div>" % self.band.id,
)

Expand Down
Loading