Open Dmitri-Sintsov opened 6 months ago
Anyone have an ETA when this will be fixed for Django 5.0+
Hello, same issue here. Is there a temporary workaround at least?
I have renamed ChoiceField._set_choices
into ChoiceField.choices
. That did the trick!
I have renamed
ChoiceField._set_choices
intoChoiceField.choices
. That did the trick!
This works with me. But i get error: bool' object has no attribute 'startswith'
My workaround is to change something under class JqueryMediaMixin line 50: ... media += Media(js=js) return media
replace with: ..make sure js is string type.. if isinstance(js, str): media += Media(js=js) return media
now it works!
PS: File to edit: ..site-packages/smart_selects/widgets.py
its fixed in 1.7.1, but v1.7.1 is not in pypi, you need to install from github
its fixed in 1.7.1, but v1.7.1 is not in pypi, you need to install from github
I install 1.7.1 from github but it has a problem on django admin
Django Version: | 5.0.6 NoReverseMatch Reverse for 'chained_filter' not found. 'chained_filter' is not a valid view function or pattern name. C:...\Lib\site-packages\django\urls\resolvers.py, line 851, in _reverse_with_prefix django.contrib.admin.options.change_view C:...\Scripts\python.exe 3.11.3
Have you had a look at this?
Thanks for explanation. @lguariento
Additionally I think documentation must be updated. installation progress is very old. for django 5;
for settings.py
USE_DJANGO_JQUERY = True
for urls.py
urlpatterns = [
path("admin/", admin.site.urls),
path('smart_selects/', include('smart_selects.urls')),
]
I have renamed
ChoiceField._set_choices
intoChoiceField.choices
. That did the trick!
this has an issue, if we are working on local and live then u need to edit files in env which is not recommended
Of course, it's just a temporary workaround. Hopefully it'll officially fixed soon.
Checklist
master
branch of django-smart-selects.smart_selects
app.models.py
,forms.py
, andviews.py
with problems.Steps to reproduce
The following error is being produced while the initialization of Django 5.0 project:
Actual behavior
Impossible to initialize
ChainedModelChoiceField.choices
.Expected behavior
Used to work fine with Django<5.0
See https://github.com/django/django/commit/500e01073adda32d5149624ee9a5cb7aa3d3583f for the reference.