django-admin-autocomplete-list-filter icon indicating copy to clipboard operation
django-admin-autocomplete-list-filter copied to clipboard

Getting ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' on Django>=4.X

Open kodekracker opened this issue 2 years ago • 6 comments

Version: django-admin-autocomplete-list-filter = "1.0.1"

Stacktrace

  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File ".venv/lib/python3.8/site-packages/djaa_list_filter/admin.py", line 13, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (.venv/lib/python3.8/site-packages/django/utils/translation/__init__.py)

django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy() are removed in Django 4.0 https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0

kodekracker avatar Sep 15 '22 19:09 kodekracker

It seems to be fixed on the main branch. Maybe they haven't released it to PyPI yet?

keyvanm avatar Oct 19 '22 18:10 keyvanm

@demirorenteknoloji Do you plan to make another release to PyPI based on the main branch to support Django 4.0?

cash avatar Nov 08 '22 18:11 cash

@vigo any plans to make another release to PyPI to support Django 4.0?

cash avatar Dec 01 '22 15:12 cash

hi @cash , i'm super sorry, i couldn't take care of this package. right now, i have some time to fix this, i'll to my best as fast as i can.

vigo avatar Dec 01 '22 19:12 vigo

@vigo Thanks. The master branch works with Django 4.0. It just needs a new release pushed to PyPI as the current release does not have this commit: https://github.com/demiroren-teknoloji/django-admin-autocomplete-list-filter/commit/239fca057b9aa29e92806fbaf2bb955f9fa8bedd

cash avatar Dec 01 '22 20:12 cash

what is the status of this? I'm still getting this error

YolCruz avatar Jan 10 '23 22:01 YolCruz

this project is deprecated, enjoy: https://github.com/vigo/django-admin-list-filter

vigo avatar May 20 '24 16:05 vigo

this project is deprecated, enjoy: https://github.com/vigo/django-admin-list-filter

u are hero 🎉

Ehco1996 avatar May 21 '24 00:05 Ehco1996

thank you

vigo avatar May 21 '24 10:05 vigo