Skip to content

Commit

Permalink
Confirmed Django 4.0 support (#78)
Browse files Browse the repository at this point in the history
* Confirmed Django 4.0 support

* Removed 'for ="..."' from RadioSelect's <label>.

Mirrors change in Django 4.0
django/django@b9e872b
  • Loading branch information
smithdc1 committed Sep 28, 2021
1 parent 08a88a2 commit ade42e9
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ jobs:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
django: [2.2.*, 3.1.*, 3.2.*]
django: [2.2.*, 3.1.*, 3.2.*, 4.0a1]
exclude:
- python-version: 3.6
django: 4.0a1
- python-version: 3.7
django: 4.0a1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG FOR CRISPY-BOOTSTRAP5

## 0.6 (2021-09-28)
* Added Django 4.0 support

## 0.5 (2021-08-20)
* Added support for [Accordion Flush](https://getbootstrap.com/docs/5.0/components/accordion/#flush) and
[Always Open](https://getbootstrap.com/docs/5.0/components/accordion/#always-open) (#63)
Expand Down Expand Up @@ -40,4 +43,4 @@ See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milest
* Converted templates from Bootstrap 4, and initial set of fixes
* Brought forward Bootstrap 4 test suite and updated for Bootstrap5

See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/1) for full changelog.
See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/1) for full changelog.
3 changes: 2 additions & 1 deletion crispy_bootstrap5/templates/bootstrap5/field.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
{% endif %}
<{% 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 %}">
{% if field.label and not field|is_checkbox and form_show_labels %}
<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 %}">
{# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #}
<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 %}">
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

VERSION = "0.5"
VERSION = "0.6"


def get_long_description():
Expand Down Expand Up @@ -30,7 +30,7 @@ def get_long_description():
license="MIT",
version=VERSION,
packages=["crispy_bootstrap5"],
install_requires=["django-crispy-forms>=1.12.0", "django>=2.2"],
install_requires=["django-crispy-forms>=1.13.0", "django>=2.2"],
extras_require={"test": ["pytest", "pytest-django"]},
tests_require=["crispy-bootstrap5[test]"],
python_requires=">=3.6",
Expand All @@ -41,6 +41,7 @@ def get_long_description():
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.1",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion tests/results/radio.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form method="post">
<div id="div_id_radio" class="mb-3">
<label for="id_radio_0" class="form-label requiredField"
<label class="form-label requiredField"
> Radio<span class="asteriskField">*</span>
</label>
<div>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form method="post">
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField" for="id_radio_0">Radio<span
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField">Radio<span
class="asteriskField">*</span></label>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input" id="id_radio_0_0" name="radio" required type="radio"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios_failing.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form method="post">
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField" for="id_radio_0">Radio<span
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField">Radio<span
class="asteriskField">*</span></label>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_0_0"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"

CRISPY_TEMPLATE_PACK = "bootstrap5"

USE_TZ = True

0 comments on commit ade42e9

Please sign in to comment.