#34721: ChoiceField/TypedChoiceField: .value() has inconsistent behaviour,
coercion
not applied.
------------------------+--------------------------------------
Reporter: Daniel | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 4.2
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+--------------------------------------
Comment (by Daniel):
Replying to [comment:2 Natalia Bidart]:
> Hello,
>
> From my initial testing, and using as a base the code you shared, the
template shows the expected behavior: when `request.POST` is empty, then
data is `None` and I see `Red` as selected which is the default. If I hard
code `data` to be, for example, `{"colour": 3}`, I see `Yellow` as
selected.
>
> Because of the above, the best place to get answers to your issue is
using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link]. Since the goal of
this issue tracker is to track issues about Django itself, and your issue
seems, at first, to be located in your custom code, I'll be closing this
ticket as invalid.
>
> If, after debugging, you find out that this is indeed a bug in Django,
please re-open with the specific details.
>
> Thank you!
Hi Natalia,
my description of the issue is accurate and you did not properly inspect
the data. It is a bug.
A sample is attached.
--
Ticket URL: <https://code.djangoproject.com/ticket/34721#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701896a788f9b-ce7d0293-62c6-4a54-bc80-2c3d76a593fc-000000%40eu-central-1.amazonses.com.