Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make django-suit compatible with Django 4.x.x #790

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion suit/admin_filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from django.utils.translation import ugettext_lazy as _
from django import VERSION as django_version

if django_version >= (3, 0):
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import ugettext_lazy as _

from django.contrib.admin import FieldListFilter


Expand Down
9 changes: 7 additions & 2 deletions suit/menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from copy import deepcopy
from django.utils.translation import ugettext_lazy as _
from django import VERSION as django_version

if django_version >= (3, 0):
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import ugettext_lazy as _


class ChildItem(object):
Expand Down Expand Up @@ -170,7 +175,7 @@ def make_child_from_native_model(self, native_model):
"""
:type native_model: dict
"""
child_item = ChildItem(native_model['name'], model=native_model.get('model'), url=native_model['admin_url'])
child_item = ChildItem(native_model['name'], model=native_model.get('model'), url=native_model['admin_url'])
return child_item

def handle_parent_menu(self, parent_item, native_app):
Expand Down