#33226: Add css class hooks to BaseForm
-----------------------------------------+------------------------
Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
`Form` has a couple of hooks to add classes to a form. See
[https://docs.djangoproject.com/en/3.2/ref/forms/api/#styling-required-or-
erroneous-form-rows docs].
However, the
[https://github.com/django/django/blob/551c997feaaa293987af8b05efc3634b93305fac/django/forms/forms.py#L54
`BaseForm`] does not have a class level initialisation of these. The
classes are then later added via a `hasattr` check.
I was wondering if class level defaults (`None`) should be added for these
to make them more discovarable, also the `hasattr` logic can just be
replaced with `Form.required_css_class`
--
Ticket URL: <https://code.djangoproject.com/ticket/33226>
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/051.2a578fa8de67e56001b12d8ce073f4c2%40djangoproject.com.