jazzband / django-smart-selects

chained and grouped selects for django forms
https://django-smart-selects.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.1k stars 348 forks source link

Django 3 issue importing six #295

Closed ccsv closed 4 years ago

ccsv commented 4 years ago

Simple issue Django 3.0+ moved six out of django.utils can we replace lines like

Not sure if this solution causes any compatibility issues with previous versions.

Steps to reproduce

  1. Install django 3.0 and smart selects
  2. Use a smart selects feature like ChainedManyToManyField
  3. You will get Import errors

Actual behavior

Error Example 1

  File "C:\Users\0\Envs\wsite\lib\site-packages\smart_selects\urls.py", line 1, in <module>
    from smart_selects import views
  File "C:\Users\0\Envs\wsite\lib\site-packages\smart_selects\views.py", line 5, in <module>
    from django.utils.six import iteritems
ModuleNotFoundError: No module named 'django.utils.six'

Error Example 2

File "C:\Users\0\Envs\wsite\lib\site-packages\smart_selects\urls.py", line 1, in <module>
    from smart_selects import views
  File "C:\Users\0\Envs\wsite\lib\site-packages\smart_selects\views.py", line 5, in <module>
    from django.utils.six import iteritems
ModuleNotFoundError: No module named 'django.utils.six'

Expected behavior

Run like normal

ccsv commented 4 years ago

As mentioned above changing the import statements will fix the issue. But I am not sure if it will interfere with any other issues.

manelclos commented 4 years ago

@ccsv this was fixed in https://github.com/jazzband/django-smart-selects/commit/c1082d91265e1809ca44ee45a65da3d457896396

Thanks for reporting. Please reopen if necessary.