Skip to content

Commit ade42e9

Browse files
authored
Confirmed Django 4.0 support (#78)
* Confirmed Django 4.0 support * Removed 'for ="..."' from RadioSelect's <label>. Mirrors change in Django 4.0 django/django@b9e872b
1 parent 08a88a2 commit ade42e9

File tree

8 files changed

+20
-8
lines changed

8 files changed

+20
-8
lines changed

.github/workflows/test.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ jobs:
1212
strategy:
1313
matrix:
1414
python-version: [3.6, 3.7, 3.8, 3.9]
15-
django: [2.2.*, 3.1.*, 3.2.*]
15+
django: [2.2.*, 3.1.*, 3.2.*, 4.0a1]
16+
exclude:
17+
- python-version: 3.6
18+
django: 4.0a1
19+
- python-version: 3.7
20+
django: 4.0a1
1621
steps:
1722
- uses: actions/checkout@v2
1823
- name: Set up Python ${{ matrix.python-version }}

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG FOR CRISPY-BOOTSTRAP5
22

3+
## 0.6 (2021-09-28)
4+
* Added Django 4.0 support
5+
36
## 0.5 (2021-08-20)
47
* Added support for [Accordion Flush](https://getbootstrap.com/docs/5.0/components/accordion/#flush) and
58
[Always Open](https://getbootstrap.com/docs/5.0/components/accordion/#always-open) (#63)
@@ -40,4 +43,4 @@ See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milest
4043
* Converted templates from Bootstrap 4, and initial set of fixes
4144
* Brought forward Bootstrap 4 test suite and updated for Bootstrap5
4245

43-
See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/1) for full changelog.
46+
See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/1) for full changelog.

crispy_bootstrap5/templates/bootstrap5/field.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{% endif %}
1212
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="mb-3{% if 'form-horizontal' in form_class %} row{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
1313
{% if field.label and not field|is_checkbox and form_show_labels %}
14-
<label {% if field.id_for_label %}for="{{ field.id_for_label }}"{% endif %} class="{% if 'form-horizontal' in form_class %}col-form-label{% else %}form-label{% endif %}{% if label_class %} {{ label_class }}{% endif %}{% if field.field.required %} requiredField{% endif %}">
14+
{# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #}
15+
<label {% if field.id_for_label and not field|is_radioselect %}for="{{ field.id_for_label }}"{% endif %} class="{% if 'form-horizontal' in form_class %}col-form-label{% else %}form-label{% endif %}{% if label_class %} {{ label_class }}{% endif %}{% if field.field.required %} requiredField{% endif %}">
1516
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
1617
</label>
1718
{% endif %}

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup
44

5-
VERSION = "0.5"
5+
VERSION = "0.6"
66

77

88
def get_long_description():
@@ -30,7 +30,7 @@ def get_long_description():
3030
license="MIT",
3131
version=VERSION,
3232
packages=["crispy_bootstrap5"],
33-
install_requires=["django-crispy-forms>=1.12.0", "django>=2.2"],
33+
install_requires=["django-crispy-forms>=1.13.0", "django>=2.2"],
3434
extras_require={"test": ["pytest", "pytest-django"]},
3535
tests_require=["crispy-bootstrap5[test]"],
3636
python_requires=">=3.6",
@@ -41,6 +41,7 @@ def get_long_description():
4141
"Framework :: Django :: 2.2",
4242
"Framework :: Django :: 3.1",
4343
"Framework :: Django :: 3.2",
44+
"Framework :: Django :: 4.0",
4445
"License :: OSI Approved :: MIT License",
4546
"Operating System :: OS Independent",
4647
"Programming Language :: Python :: 3",

tests/results/radio.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<form method="post">
22
<div id="div_id_radio" class="mb-3">
3-
<label for="id_radio_0" class="form-label requiredField"
3+
<label class="form-label requiredField"
44
> Radio<span class="asteriskField">*</span>
55
</label>
66
<div>

tests/results/test_grouped_radios.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form method="post">
2-
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField" for="id_radio_0">Radio<span
2+
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField">Radio<span
33
class="asteriskField">*</span></label>
44
<div><strong>Audio</strong>
55
<div class="form-check"><input class="form-check-input" id="id_radio_0_0" name="radio" required type="radio"

tests/results/test_grouped_radios_failing.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form method="post">
2-
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField" for="id_radio_0">Radio<span
2+
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField">Radio<span
33
class="asteriskField">*</span></label>
44
<div><strong>Audio</strong>
55
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_0_0"

tests/test_settings.py

+2
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@
5353
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
5454

5555
CRISPY_TEMPLATE_PACK = "bootstrap5"
56+
57+
USE_TZ = True

0 commit comments

Comments
 (0)