Home > database >  Understand `_html_output()` from Django Forms Source Code
Understand `_html_output()` from Django Forms Source Code

Time:12-24

Below source code is from django/forms/forms.py

class BaseForm(RenderableFormMixin):
    def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row):
    "Output HTML. Used by as_table(), as_ul(), as_p()."

How is this private method _html_output() used / invoked by as_table(), as_ul(), as_p() please ? I did not find out from the source code.

CodePudding user response:

The method is no longer used

https://docs.djangoproject.com/en/4.0/releases/4.0/#id2

Since form rendering now uses the template engine, the undocumented BaseForm._html_output() helper method is deprecated

  • Related