#32923: Add Field._clean_bound_field() to remove isinstance check in
BaseForm._clean_fields()
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: Chris Jerdonek
Jerdonek |
Type: | Status: assigned
Cleanup/optimization |
Component: Forms | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This is a follow-up to ticket #32920.
Currently, `BaseForm._clean_fields()` does an instance check for each
field to special-case `FileField`:
https://github.com/django/django/blob/f5669fd7b568cf8a3eda1e65c1c6fb583c7b177d/django/forms/forms.py#L396-L400
I noticed that if `Field` grows a `_clean_bound_field(bf)` method, then
the special-casing could be handled by overriding `_clean_bound_field()`
in `FileField`, and `_clean_fields()` would become simpler.
--
Ticket URL: <https://code.djangoproject.com/ticket/32923>
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/052.f026ac64726d7c26b7b42e5a64fa9250%40djangoproject.com.