﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35881	MultiWidget bypasses subwidget rendering customization	Adam Johnson	Muhammad Usman	"[https://docs.djangoproject.com/en/stable/ref/forms/widgets/#django.forms.Widget.render Widget.render] is documented as the place to override rendering behaviour, with the top of `Widget` docs saying:

> You may also implement or override the render() method on custom widgets.

On top of this, the [https://docs.djangoproject.com/en/stable/ref/forms/renderers/#the-low-level-render-api renderer API] is touted as another way to customize how widgets are rendered.

`MultiWidget` bypasses both of these for its subwidgets. Rather than go through their `render()` methods, it uses a template that just includes the subwidget templates:

{{{
{% spaceless %}{% for widget in widget.subwidgets %}{% include widget.template_name %}{% endfor %}{% endspaceless %}
}}}

I encountered this issue on a project with custom templates, where a MultiValueField from a third-party package dropped the custom styles.

One solution could be to make a `MultiWidget.render()` method that calls each subwidget's `render()` method and glues the results together.

Another would be to make the existing `MultiWidget.get_context` pass each subwidget's render method into the context, and then the template could call it.

One backwards compatibility concern is continuing to work if the user has customized `multiwidget.html`, where they may be relying on the old context data and using `{% include subwidget.template_name %}`."	Bug	assigned	Forms	dev	Normal			David Smith	Accepted	1	0	1	1	0	0
