#26729: TabularInline not respecting form's custom label and help text if set in form's __init__ method -------------------------------+------------------------------------ Reporter: nrogers64 | Owner: nobody Type: Bug | Status: new Component: contrib.admin | Version: 1.9 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+------------------------------------
Comment (by czpython): I've done a little digging on this. The problem is that the field labels need to be resolved before rendering the forms and so currently Django will look at the {{{base_fields}}} attribute of the formset form class instead of creating an instance of the form class. This means that the {{{__init__}}} method is never called when generating the table headers and so no modifications there will be considered. As a solution we would create a throw away instance of the formset form class and fetch the field from its {{{fields}}} attribute but I don't like the idea of creating an empty form instance without the developer having a way to modify its initialization arguments. I've attached a path for the suggested solution. -- Ticket URL: <https://code.djangoproject.com/ticket/26729#comment:2> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.56d8d38f7cc575c230cda4910ab865a7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.