#34532: Form.default_renderer is ignored in formsets.
----------------------------------+------------------------------------
Reporter: Ryan Burt | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 4.2
Severity: Normal | Resolution:
Keywords: default_renderer | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by David Smith):
Here's a scenario.
{{{
class CustomFormRenderer(TemplatesSetting):
...
class MyForm(Form):
name = CharField()
default_renderer = CustomFormRenderer
class CustomFormsetRenderer(Jinja2):
...
MyFormSet = formset_factory(MyForm, renderer=CustomFormsetRenderer)
}}}
Should `MyForm` be rendered with the `CustomFormRenderer` of the
`CustomFormsetRenderer`.
The way that I've thought about this to date is that whatever gets used at
the highest level (formset -> form -> widget) gets passed down to the
lower levels so that the same renderer is used for the whole form/formset.
Does passing your custom renderer `modelformset_factory` work for you?
I think even if no code changes were agreed for this ticket there may be
some doc changes needed.
--
Ticket URL: <https://code.djangoproject.com/ticket/34532#comment:6>
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/010701882333b93d-e96a80db-22de-4c88-8b72-5ec07d01b755-000000%40eu-central-1.amazonses.com.