#34532: Overriding ModelForm default_renderer has no effect as forms api always
uses renderer from settings
----------------------------------+--------------------------------------
     Reporter:  Ryan Burt         |                    Owner:  nobody
         Type:  Bug               |                   Status:  closed
    Component:  Forms             |                  Version:  4.2
     Severity:  Normal            |               Resolution:  needsinfo
     Keywords:  default_renderer  |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------

Comment (by Ryan Burt):

 I'll provide a sample project shortly, but to answer the second question,
 I'm initializing my forms through the modelformset_factory.

 This got me on the right track, I've reviewed the code in
 forms/formsets.py and the renderer is passed in the attrs via `'render':
 renderer or get_default_renderer()` on line 571.
 This an addition from commit
 
[https://github.com/django/django/commit/456466d932830b096d39806e291fe23ec5ed38d5
 456466d].


 If I suppress `FORM_RENDERER` in my settings.py, `get_default_renderer()`
 returns the default of  'django.forms.renderers.DjangoTemplates', so this
 could be an unintended consequence of the changes in that commit

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34532#comment:3>
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/01070187e00d2e3d-adee10d6-0c65-4909-b892-61b8c4a78ce5-000000%40eu-central-1.amazonses.com.

Reply via email to