summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2020-05-01 13:37:21 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-04 12:10:47 +0200
commitd17b380653da5f95885ce53468fe7aac60672841 (patch)
tree9fbe962d480093a45cf238d22596812637765c74 /docs/ref/models
parent787981f9d1d5abc489a0b069e3353b8ad7aa9778 (diff)
Refs #30573 -- Rephrased "Of Course" and "Obvious(ly)" in documentation and comments.
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/database-functions.txt4
-rw-r--r--docs/ref/models/fields.txt2
-rw-r--r--docs/ref/models/instances.txt8
-rw-r--r--docs/ref/models/querysets.txt4
4 files changed, 8 insertions, 10 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index d0043857cd..b702085e77 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -517,8 +517,8 @@ should typically be used instead of the more verbose equivalent,
e.g. use ``TruncYear(...)`` rather than ``Trunc(..., kind='year')``.
The subclasses are all defined as transforms, but they aren't registered with
-any fields, because the obvious lookup names are already reserved by the
-``Extract`` subclasses.
+any fields, because the lookup names are already reserved by the ``Extract``
+subclasses.
Usage example::
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 036a2c996e..e266715a36 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1058,8 +1058,6 @@ directory on the filesystem. Has some special arguments, of which the first is
whether folders in the specified location should be included. Either this
or :attr:`~FilePathField.allow_files` must be ``True``.
-Of course, these arguments can be used together.
-
The one potential gotcha is that :attr:`~FilePathField.match` applies to the
base filename, not the full path. So, this example::
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 43ed5934ca..06c63eba04 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -116,8 +116,8 @@ are loaded from the database::
super().save(*args, **kwargs)
The example above shows a full ``from_db()`` implementation to clarify how that
-is done. In this case it would of course be possible to use ``super()`` call in
-the ``from_db()`` method.
+is done. In this case it would be possible to use a ``super()`` call in the
+``from_db()`` method.
Refreshing objects from database
================================
@@ -528,8 +528,8 @@ Updating attributes based on existing fields
--------------------------------------------
Sometimes you'll need to perform a simple arithmetic task on a field, such
-as incrementing or decrementing the current value. The obvious way to
-achieve this is to do something like::
+as incrementing or decrementing the current value. One way of achieving this is
+doing the arithmetic in Python like::
>>> product = Product.objects.get(name='Venezuelan Beaver Cheese')
>>> product.number_sold += 1
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index c51c4dd43a..cd22b03418 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1135,8 +1135,8 @@ This will fetch the best pizza and all the toppings for the best pizza for each
restaurant. This will be done in 3 database queries - one for the restaurants,
one for the 'best pizzas', and one for the toppings.
-Of course, the ``best_pizza`` relationship could also be fetched using
-``select_related`` to reduce the query count to 2:
+The ``best_pizza`` relationship could also be fetched using ``select_related``
+to reduce the query count to 2::
>>> Restaurant.objects.select_related('best_pizza').prefetch_related('best_pizza__toppings')