django-crispy-forms v2.0 Release Notes

    • ✂ Removed |safe filter from field and prepended/appended text. To retain the previous behaviour use mark_safe() to mark the text as safe in your project. Refs #296.

    • ✂ Removed uni-form template pack. Uni-Form specific classes previously added to every template pack e.g. textInput and are now removed. If you require these classes then the previous behaviour can be restored by adding the following to CRISPY_CLASS_CONVERTERS in your settings file.

        converters = {
          "textinput": "textinput textInput",
          "fileinput": "fileinput fileUpload",
          "passwordinput": "textinput textInput",
      }
    
    • 0️⃣ The uni-form template pack allowed for rendering of templates using a default or inline layout. As the uni-form template pack has been removed support for this has also been removed. This has resulted in the following BREAKING changes.

      • The form_style attribute of FormHelper is removed.
      • The form_style positional argument to render_field is removed.
      • The form_style positional argument to the render method of all LayoutObjects is removed.
    • ✂ Removed Bootstrap 2 template pack. Bootstrap 3 and 4 support is provided by the core crispy-forms package. Support for Bootstrap 5 is provided by a 3rd party package under the django-crispy-forms organisation at crispy-bootstrap5.

    • Default template pack is now bootstrap4 if the CRISPY_TEMPLATE_PACK setting is not provided.

    • The get_layout_objects() and get_field_names() functions of LayoutObject now return a list of Pointers rather than a list of lists. Pointers are a dataclass containing a list of posistions and the name of object/field.

    • 🚚 The html5_required attribute of FormHelper is removed. In all supported versions of Django the required attribute is provided by the core forms module.

    • The FormActions layout object learnt a css_id kwarg to add an id to the rendered <div>

    • 🚚 The flat_attrs() method of FormActions is removed. Attributes provided by **kwargs are now passed via the flat_attrs function during __init__() instead of with each call of render().

    • The default values of "form_error_title" and "formset_error_title" of FormHelper changed from None to "".

    • ⬇️ Dropped support for Django 2.2.

    • ➕ Added support for Django 4.1.