Skip to content

Commit

Permalink
Change Django compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
melbic committed Jul 28, 2022
1 parent 13b2981 commit e6f6426
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ v1.0.12, 2020/01/24 -- added feature filter keys in admin
v1.0.13, 2020/02/04 -- added support for Django 2.2
v1.0.14, 2020/02/04 -- added feature to use django-translator for custom models
v1.0.15, 2021/11/11 -- added support for Django 3.1
v1.1.0, 2022/07/28 -- Support custom cache duration
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()

reqs = ['Django>=1.7', 'django-modeltranslation>=0.10.0', 'django-taggit>= 0.12.0']
reqs = ['Django>=3.2', 'django-modeltranslation>=0.18.4', 'django-taggit>= 2.0.0']

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
Expand Down
2 changes: 1 addition & 1 deletion translator/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from modeltranslation.admin import TranslationAdmin

from translator.models import Translation
Expand Down
7 changes: 1 addition & 6 deletions translator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.utils.functional import classproperty
from taggit.managers import TaggableManager

from translator.util import get_key

try:
# Django 3.1 and above
from django.utils.functional import classproperty
except ImportError:
from django.utils.decorators import classproperty


class TranslationBase(models.Model):
key = models.CharField(max_length=255, unique=True)
Expand Down

0 comments on commit e6f6426

Please sign in to comment.