1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.

This commit is contained in:
Simon Charette
2020-06-06 14:34:38 -04:00
committed by Mariusz Felisiak
parent 1e38f1191d
commit 156a2138db
7 changed files with 34 additions and 103 deletions

View File

@@ -100,7 +100,7 @@ An example::
>>>
>>> from datetime import date, timedelta
>>> from django.db.models import Case, CharField, Value, When
>>> from django.db.models import Case, Value, When
>>> Client.objects.create(
... name='Jane Doe',
... account_type=Client.REGULAR,
@@ -119,7 +119,6 @@ An example::
... When(account_type=Client.GOLD, then=Value('5%')),
... When(account_type=Client.PLATINUM, then=Value('10%')),
... default=Value('0%'),
... output_field=CharField(),
... ),
... ).values_list('name', 'discount')
<QuerySet [('Jane Doe', '0%'), ('James Smith', '5%'), ('Jack Black', '10%')]>
@@ -141,7 +140,6 @@ the ``Client`` has been with us, we could do so using lookups::
... When(registered_on__lte=a_year_ago, then=Value('10%')),
... When(registered_on__lte=a_month_ago, then=Value('5%')),
... default=Value('0%'),
... output_field=CharField(),
... )
... ).values_list('name', 'discount')
<QuerySet [('Jane Doe', '5%'), ('James Smith', '0%'), ('Jack Black', '10%')]>