[3.1.x] Added backticks to code literals in various docs.

Backport of 550297d20d from master
This commit is contained in:
Jon Dufresne 2020-12-14 22:19:00 -08:00 committed by Mariusz Felisiak
parent 092a25dcf2
commit 5d41fd22dc
6 changed files with 11 additions and 9 deletions

View File

@ -1323,7 +1323,7 @@ generating choices. See :ref:`iterating-relationship-choices` for details.
.. class:: ModelMultipleChoiceField(**kwargs) .. class:: ModelMultipleChoiceField(**kwargs)
* Default widget: :class:`SelectMultiple` * Default widget: :class:`SelectMultiple`
* Empty value: An empty ``QuerySet`` (self.queryset.none()) * Empty value: An empty ``QuerySet`` (``self.queryset.none()``)
* Normalizes to: A ``QuerySet`` of model instances. * Normalizes to: A ``QuerySet`` of model instances.
* Validates that every id in the given list of values exists in the * Validates that every id in the given list of values exists in the
queryset. queryset.

View File

@ -568,7 +568,7 @@ all of the model fields from being updated in the database. For example::
product.save(update_fields=['name']) product.save(update_fields=['name'])
The ``update_fields`` argument can be any iterable containing strings. An The ``update_fields`` argument can be any iterable containing strings. An
empty ``update_fields`` iterable will skip the save. A value of None will empty ``update_fields`` iterable will skip the save. A value of ``None`` will
perform an update on all fields. perform an update on all fields.
Specifying ``update_fields`` will force an update. Specifying ``update_fields`` will force an update.

View File

@ -814,8 +814,8 @@ ambiguous datetimes in daylight saving time. By default (when ``is_dst=None``),
.. method:: none() .. method:: none()
Calling none() will create a queryset that never returns any objects and no Calling ``none()`` will create a queryset that never returns any objects and no
query will be executed when accessing the results. A qs.none() queryset query will be executed when accessing the results. A ``qs.none()`` queryset
is an instance of ``EmptyQuerySet``. is an instance of ``EmptyQuerySet``.
Examples:: Examples::

View File

@ -127,7 +127,8 @@ composite keys in future releases of Django, the
This method takes no arguments, and returns a tuple of four items: This method takes no arguments, and returns a tuple of four items:
* ``name``: The field's attribute name on its parent model, or None if it is not part of a model * ``name``: The field's attribute name on its parent model, or ``None`` if it
is not part of a model
* ``path``: A dotted, Python path to the class of this field, including the class name. * ``path``: A dotted, Python path to the class of this field, including the class name.
* ``args``: Positional arguments, as a list * ``args``: Positional arguments, as a list
* ``kwargs``: Keyword arguments, as a dict * ``kwargs``: Keyword arguments, as a dict

View File

@ -47,9 +47,9 @@ check function::
return errors return errors
The check function *must* accept an ``app_configs`` argument; this argument is The check function *must* accept an ``app_configs`` argument; this argument is
the list of applications that should be inspected. If None, the check must be the list of applications that should be inspected. If ``None``, the check must
run on *all* installed apps in the project. The ``**kwargs`` argument is required be run on *all* installed apps in the project. The ``**kwargs`` argument is
for future expansion. required for future expansion.
Messages Messages
-------- --------

View File

@ -1224,7 +1224,8 @@ Things get more complicated if you use inheritance. Consider a subclass of
django_blog = ThemeBlog(name='Django', tagline='Django is easy', theme='python') django_blog = ThemeBlog(name='Django', tagline='Django is easy', theme='python')
django_blog.save() # django_blog.pk == 3 django_blog.save() # django_blog.pk == 3
Due to how inheritance works, you have to set both ``pk`` and ``id`` to None:: Due to how inheritance works, you have to set both ``pk`` and ``id`` to
``None``::
django_blog.pk = None django_blog.pk = None
django_blog.id = None django_blog.id = None