summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2018-05-12 19:37:42 +0200
committerGitHub <noreply@github.com>2018-05-12 19:37:42 +0200
commit35319bf12ccefe1911588493484160aa49208f89 (patch)
treefe1cb029786e49622e6ba3af3ddf3dc9956502ff /docs/ref/models
parent1b7d524cfa7b7834af26c99407af66be6813938d (diff)
Alphabetized imports in various docs.
Follow-up of d97cce34096043b019e818a7fb98c0f9f073704c and 7d3fe36c626a3268413eb86d37920f132eb4a54f.
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/conditional-expressions.txt4
-rw-r--r--docs/ref/models/database-functions.txt2
-rw-r--r--docs/ref/models/expressions.txt4
-rw-r--r--docs/ref/models/instances.txt2
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/ref/models/conditional-expressions.txt b/docs/ref/models/conditional-expressions.txt
index 643bdddae0..80146917d7 100644
--- a/docs/ref/models/conditional-expressions.txt
+++ b/docs/ref/models/conditional-expressions.txt
@@ -48,7 +48,7 @@ keyword.
Some examples::
- >>> from django.db.models import When, F, Q
+ >>> from django.db.models import F, Q, When
>>> # String arguments refer to fields; the following two examples are equivalent:
>>> When(account_type=Client.GOLD, then='name')
>>> When(account_type=Client.GOLD, then=F('name'))
@@ -88,7 +88,7 @@ A simple example::
>>>
>>> from datetime import date, timedelta
- >>> from django.db.models import CharField, Case, Value, When
+ >>> from django.db.models import Case, CharField, Value, When
>>> Client.objects.create(
... name='Jane Doe',
... account_type=Client.REGULAR,
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index d86853cc12..494c175843 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -979,7 +979,7 @@ than 0. If ``length`` is ``None``, then the rest of the string will be returned.
Usage example::
>>> # Set the alias to the first 5 characters of the name as lowercase
- >>> from django.db.models.functions import Substr, Lower
+ >>> from django.db.models.functions import Lower, Substr
>>> Author.objects.create(name='Margaret Smith')
>>> Author.objects.update(alias=Lower(Substr('name', 1, 5)))
1
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index 1fdc5f7116..a929e8a98f 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -26,7 +26,7 @@ Some examples
.. code-block:: python
- from django.db.models import F, Count, Value
+ from django.db.models import Count, F, Value
from django.db.models.functions import Length, Upper
# Find companies that have more employees than chairs.
@@ -252,7 +252,7 @@ is null) after companies that have been contacted::
database functions like ``COALESCE`` and ``LOWER``, or aggregates like ``SUM``.
They can be used directly::
- from django.db.models import Func, F
+ from django.db.models import F, Func
queryset.annotate(field_lower=Func(F('field'), function='LOWER'))
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 73bbeb8f31..23572f7362 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -277,7 +277,7 @@ will be stored in a special error dictionary key,
:data:`~django.core.exceptions.NON_FIELD_ERRORS`. This key is used for errors
that are tied to the entire model instead of to a specific field::
- from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
+ from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
try:
article.full_clean()
except ValidationError as e: