django_forms_rendering
Disallows using Django’s convenience form rendering helpers, for which the markup isn’t screen-reader-friendly
User impact: Serious
This rule supports the following configuration:
- TOML
- Shell
# Forms cannot be rendered with as_table, as_ul, or as_pdjango_forms_rendering = true# Allows as_pdjango_forms_rendering = "as_p"
# Forms cannot be rendered with as_table, as_ul, or as_pcurlylint --rule 'django_forms_rendering: true' .# Allows as_pcurlylint --rule 'django_forms_rendering: "as_p"' .
#
Success- TOML
- Shell
<!-- Good: Render a single field manually --><!-- django_forms_rendering = true -->{{ form.username }}<!-- Good: as_p can be allowed --><!-- django_forms_rendering = "as_p" -->{{ form.as_p }}
<!-- Good: Render a single field manually --><!-- curlylint --rule 'django_forms_rendering: true' . -->{{ form.username }}<!-- Good: as_p can be allowed --><!-- curlylint --rule 'django_forms_rendering: "as_p"' . -->{{ form.as_p }}
#
Fail- TOML
- Shell
<!-- Bad: Disallows as_table --><!-- django_forms_rendering = true -->{{ form.as_table }}<!-- Bad: Disallows as_ul too --><!-- django_forms_rendering = true -->{{ form.as_ul }}<!-- Bad: Disallows as_p too --><!-- django_forms_rendering = true -->{{ form.as_p }}
<!-- Bad: Disallows as_table --><!-- curlylint --rule 'django_forms_rendering: true' . -->{{ form.as_table }}<!-- Bad: Disallows as_ul too --><!-- curlylint --rule 'django_forms_rendering: true' . -->{{ form.as_ul }}<!-- Bad: Disallows as_p too --><!-- curlylint --rule 'django_forms_rendering: true' . -->{{ form.as_p }}