burke-software / django-mass-edit

Make bulk changes in the Django admin interface
152 stars 67 forks source link

Django 4.0 Support #97

Closed martin-schlossarek closed 2 years ago

martin-schlossarek commented 2 years ago

Seems like django-mass-edit does not work with Django 4.0:

$ python manage.py --help
Traceback (most recent call last):
  File "/home/somehome/someproject/manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/django/core/management/__init__.py", line 425, in execute_from_command_line
    utility.execute()
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/django/core/management/__init__.py", line 401, in execute
    django.setup()
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/massadmin/apps.py", line 11, in ready
    from .massadmin import mass_change_selected
  File "/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/massadmin/massadmin.py", line 51, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/home/somehome/.local/share/virtualenvs/someproject-kDcDKEru/lib/python3.10/site-packages/django/utils/translation/__init__.py)

The mentioned ugettext_lazy method was deprecated since Django 3.0 and is now finally removed from Django 4.0:

https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0

PetrDlouhy commented 2 years ago

@martin-schlossarek I have committed fix in master branch. Could you please verify, it works for you?

tiagocordeiro commented 2 years ago

@PetrDlouhy I just tested it locally and it works fine with django 4. When do you want to publish an update on pypi?

Thanks!

PetrDlouhy commented 2 years ago

Unfortunately I don't have access to do that. @bufke Could you please make a new release? I did make all the tests working so it should be easy.

@danialmalik Maybe we could wait for your MR #96, if you finish it soon.

danialmalik commented 2 years ago

Hi @PetrDlouhy,

Sorry for the delay, I have been stuck in some stuff. I'll probably finalize the fix PR some time today.

PetrDlouhy commented 2 years ago

@danialmalik No problem thank you very much that you managed it.

@bufke I prepared everything for the release 3.4.1, so you would just have to upload it to PyPI.

bufke commented 2 years ago

Can do, I'm going to update the compose file, as I like testing that way. I see you uploaded a github actions file. Should I remove the older .travis.yml? It's targeting mostly obsolete versions of python/django.

bufke commented 2 years ago

Done https://pypi.org/project/django-mass-edit/3.4.1/

PetrDlouhy commented 2 years ago

@bufke I deleted the .travis.yml, it was obsolete and merged your MR. Thank you for the release.