#34711: form.has_changed() is always True for IntegerChoices Enum Model Field
------------------------+--------------------------------------
Reporter: GHPS | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 4.2
Severity: Normal | Resolution:
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 David Sanders):
Hi GHPS,
Thanks for taking the time to setup a small test project, though
unfortunately the issue isn't with Django in this case; it's with the
sample project's code.
If you want to manually override model form fields you must be sure to use
the correct form field type. In the case of an `IntegerField` with
`choices` you must use a
[https://docs.djangoproject.com/en/4.2/ref/forms/fields/#typedchoicefield
TypedChoiceField] A model form will use these automatically for an
`IntegerField` by default.
Regards,
David
--
Ticket URL: <https://code.djangoproject.com/ticket/34711#comment:5>
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/01070189605231b5-912be1e7-4f7a-4503-a9fd-8c546c07998c-000000%40eu-central-1.amazonses.com.