Releases: django-crispy-forms/django-crispy-forms
2.1
What's Changed
- Added support for Django 5.0.
- Dropped support for Django 3.2, 4.0 and 4.1.
- Added support for Python 3.12.
- Dropped support for Python 3.7.
New Contributors
- @DanielSwain made their first contribution in #1340
- @sankarebarri made their first contribution in #1342
- @foarsitter made their first contribution in #1353
Full Changelog: 2.0...2.1
2.0
2.0 (2023-02-13)
Major Changes and Migration Guide
-
Removed all Bootstrap template packs. These template packs are now available as standalone packages.
To upgrade, install the required template pack and add it to your
INSTALLED_APPS
setting.Also, support for Bootstrap 5 is provided by a 3rd party package under the
django-crispy-forms
organisation at
crispy-bootstrap5. -
Removed uni-form template pack. Uni-Form specific classes previously added to every template pack e.g.
textInput
are now removed.
If you require these classes, 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", }
-
The
uni-form
template pack allowed for rendering of templates using adefault
orinline
layout. As theuni-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 ofFormHelper
is removed. - The
form_style
positional argument torender_field()
is removed. - The
form_style
positional argument to therender()
method of allLayoutObjects
is removed.
Audit for use of
render()
andrender_field()
due to the removal of theform_style
positional argument is therefore
required. For example:# django-crispy-forms 1.x html = my_layout_object.render(form, form_style, context) # django-crispy-forms 2.x html = my_layout_object.render(form, context)
- The
-
Widespread use of the
|safe
in crispy-form templates is removed. Audit for html input in your forms
especially for Field and Prepended/Appended text. To retain the previous behaviour mark text as safe
in your project code using
mark_safe()
. Refs #296.
Other Changes
- Dropped support for Django 2.2.
- Added support for Django 4.1 and 4.2.
- Added support for Python 3.11.
- The
flat_attrs()
method ofFormActions
is removed. Attributes provided by**kwargs
are now passed via theflat_attrs
function during__init__()
instead of with each call ofrender()
- The
html5_required
attribute ofFormHelper
is removed. In all supported versions of Django therequired
attribute is provided by the coreforms
module. - The
FormActions
layout object learnt acss_id
kwarg to add anid
to the rendered<div>
- The default values of "form_error_title" and "formset_error_title" of FormHelper changed from
None
to""
. - An attribute error is now raised if the
CRISPY_TEMPLATE_PACK
setting is not provided. - The
get_layout_objects()
andget_field_names()
functions ofLayoutObject
now return a list ofPointers
rather than a list
of lists. Pointers are adataclass
containing a list ofposistions
and thename
of object/field.
2.0a1
2.0a1 (2023-01-18)
Major Changes and Migration Guide
-
Removed all Bootstrap template packs. These template packs are now available as standalone packages.
To upgrade, install the required template pack and add it to your
INSTALLED_APPS
setting.Also, support for Bootstrap 5 is provided by a 3rd party package under the
django-crispy-forms
organisation at
crispy-bootstrap5. -
Removed uni-form template pack. Uni-Form specific classes previously added to every template pack e.g.
textInput
are now removed.
If you require these classes, 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", }
-
The
uni-form
template pack allowed for rendering of templates using adefault
orinline
layout. As theuni-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 ofFormHelper
is removed. - The
form_style
positional argument torender_field()
is removed. - The
form_style
positional argument to therender()
method of allLayoutObjects
is removed.
Audit for use of
render()
andrender_field()
due to the removal of theform_style
positional argument is therefore
required. For example:# django-crispy-forms 1.x html = my_layout_object.render(form, form_style, context) # django-crispy-forms 2.x html = my_layout_object.render(form, context)
- The
-
Widespread use of the
|safe
in crispy-form templates is removed. Audit for html input in your forms
especially for Field and Prepended/Appended text. To retain the previous behaviour mark text as safe
in your project code using
mark_safe()
. Refs #296.
Other Changes
- Dropped support for Django 2.2.
- Added support for Django 4.1 and 4.2.
- Added support for Python 3.11.
- The
flat_attrs()
method ofFormActions
is removed. Attributes provided by**kwargs
are now passed via theflat_attrs
function during__init__()
instead of with each call ofrender()
- The
html5_required
attribute ofFormHelper
is removed. In all supported versions of Django therequired
attribute is provided by the coreforms
module. - The
FormActions
layout object learnt acss_id
kwarg to add anid
to the rendered<div>
- The default values of "form_error_title" and "formset_error_title" of FormHelper changed from
None
to""
. - An attribute error is now raised if the
CRISPY_TEMPLATE_PACK
setting is not provided. - The
get_layout_objects()
andget_field_names()
functions ofLayoutObject
now return a list ofPointers
rather than a list
of lists. Pointers are adataclass
containing a list ofposistions
and thename
of object/field.
1.14.0
What's Changed
- Updated meta
license-file
in setup.cfg by @smithdc1 in #1188 - Remove bs3 styles from crispy_forms_field by @smithdc1 in #1003
- Fix css id for non ascii characters by @smithdc1 in #1190
- Simplified adding wrapper_class to context when rendering PrependedApppendedText by @smithdc1 in #1191
- Added support for Python 3.10 by @smithdc1 in #1189
- Refs #938 -- Avoid attributes being duplicated by @smithdc1 in #1194
- Fix mismatched HTML tag by @wgordon17 in #1201
- Dropped support for Python 3.6 and Django 3.1. by @smithdc1 in #1205
- Fixed Bootstrap4 Field with buttons input size by @smithdc1 in #1159
- Removed empty class attribute if field class is None by @smithdc1 in #1208
- Create a bootstrap modal layout object by @nsandler1 in #1204
New Contributors
- @wgordon17 made their first contribution in #1201
- @nsandler1 made their first contribution in #1204
Full Changelog: 1.13.0...1.14.0
Version 1.13.0
1.13.0 (2021-09-25)
- Added support for Django 4.0
Version 1.12.0
- Fixed rendering of grouped checkboxes and radio inputs in the Bootstrap 4 template pack. (#1155)
- Introduced new
input_size
argument toAppendedText
,PrependedText
andPrependedAppendedText
. This allows the size of these grouped inputs to be changed in the Bootstrap 4 template pack. (#1114) - Confirmed support for Django 3.2
- Dropped support for Python 3.5
- Dropped support for Django 3.0
See the 1.12.0 Milestone for the full change list.
Version 1.11.2
- Added HTML parsing tools to help testing of template packs (#1128)
- Fixed rendering of all widget attributes for file fields (#1130)
See the 1.11.2 Milestone for the full change list.
Version 1.11.1
- Added
custom-select
for select widgets within prepended and appended fields (#1116)
See the 1.11.1 Milestone for the full change list.
Version 1.11.0
- Implemeneted
custom-select
for Select widgets in the Bootstrap4 Template Pack (#1091) - Fixed
data-parent
in AccodrianGroup (#1091) - Documentation improvements
See the 1.11.0 Milestone for the full change list
Version 1.10.0
1.10.0 (18.11.2020)
- Fixed test causing
SystemCheckError
in some cases. (#1075) - Radio and Checkbox now respect the field's
disabled
attribute when using the Bootstrap4 template pack. (#1057) - A number of documentation improvements.
See the 1.10.0 Milestone for the full change list