mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.
This commit is contained in:
committed by
Mariusz Felisiak
parent
1e38f1191d
commit
156a2138db
@@ -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%')]>
|
||||
|
||||
Reference in New Issue
Block a user