Skip to content

Commit 3d553bb

Browse files
authored
Merge pull request #8 from voxy/VOXY-6030-actualize-django-requirements
VOXY-6030: Upgrade to Django 4.2 [DO NOT MERGE]
2 parents 083ccb5 + 27b3422 commit 3d553bb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

bootstrap_select/widgets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.templatetags.static import static
22
from django import forms
33
from django.forms import Select
4-
from django.utils.encoding import force_text
4+
from django.utils.encoding import force_str
55
from django.utils.html import format_html
66
from django.utils.safestring import mark_safe
77

@@ -49,7 +49,7 @@ def __init__(self, attrs=None, choices=(), **kwargs):
4949
def render_option(self, selected_choices, option_value, option_label):
5050
if option_value is None:
5151
option_value = ''
52-
option_value = force_text(option_value)
52+
option_value = force_str(option_value)
5353
if option_value in selected_choices:
5454
selected_html = mark_safe(' selected="selected"')
5555
if not self.allow_multiple_selected:
@@ -59,10 +59,10 @@ def render_option(self, selected_choices, option_value, option_label):
5959
selected_html = ''
6060

6161
html = '<option value="{}"'.format(option_value)
62-
html += ' data-content="{}"'.format(force_text(option_label))
62+
html += ' data-content="{}"'.format(force_str(option_label))
6363
if self.attrs.get('data-live-search'):
6464
html += ' data-tokens="{}"'.format(option_value)
65-
html += '{}>{}</option>'.format(selected_html, force_text(option_label))
65+
html += '{}>{}</option>'.format(selected_html, force_str(option_label))
6666
return format_html(html)
6767

6868
# Django 1.11

example/example/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
1212
Including another URLconf
1313
1. Import the include() function: from django.conf.urls import url, include
14+
note: django.conf.urls was deleted in 4.2, use re_path instead
1415
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
1516
"""
16-
from django.conf.urls import url
17+
from django.urls import re_path
1718
from django.contrib import admin
1819

1920

2021
urlpatterns = [
21-
url(r'^admin/', admin.site.urls),
22+
re_path(r'^admin/', admin.site.urls),
2223
]

0 commit comments

Comments
 (0)