diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2018-05-12 19:37:42 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2018-05-12 19:41:40 +0200 |
| commit | 80a53202d416baeba096e8b91a011f163ff31853 (patch) | |
| tree | 01acc42486208c3f72b267da1cf2dcf35fa52bb0 /docs/ref/models | |
| parent | 840c0ed13d1754f89c3c010f957f5c4a20a3c7c6 (diff) | |
[2.0.x] Alphabetized imports in various docs.
Follow-up of d97cce34096043b019e818a7fb98c0f9f073704c and 7d3fe36c626a3268413eb86d37920f132eb4a54f.
Backport of 35319bf12ccefe1911588493484160aa49208f89 from master
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/conditional-expressions.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/database-functions.txt | 2 | ||||
| -rw-r--r-- | docs/ref/models/expressions.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 2 |
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 4023de9182..d69f2b9fc7 100644 --- a/docs/ref/models/database-functions.txt +++ b/docs/ref/models/database-functions.txt @@ -804,7 +804,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 26ce4bd07a..ef3688df97 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -22,7 +22,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. @@ -244,7 +244,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 c327b0e9e7..9e63e4c6ff 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -282,7 +282,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: |
