Skip to content

Commit c72cc92

Browse files
authored
Merge pull request #255 from theunraveler/django_3
Django 3
2 parents 5bfd60a + 514eb4e commit c72cc92

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717
- TOX_ENV=py37-dj111
1818
- TOX_ENV=py37-dj20
1919
- TOX_ENV=py37-dj21
20+
- TOX_ENV=py37-dj30
2021
before_install:
2122
- pyenv install 2.7 --skip-existing
2223
- pyenv install 3.7 --skip-existing

ajax_select/fields.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import unicode_literals
22

33
import json
4+
import sys
5+
from six import text_type
46
from django import forms
57
from django.conf import settings
68
from django.contrib.contenttypes.models import ContentType
@@ -11,11 +13,14 @@
1113
from django.utils.encoding import force_text
1214
from django.utils.module_loading import import_string
1315
from django.utils.safestring import mark_safe
14-
from django.utils.six import text_type
15-
from django.utils.translation import ugettext as _
1616

1717
from ajax_select.registry import registry
1818

19+
if sys.version_info.major >= 3:
20+
from django.utils.translation import gettext as _
21+
else:
22+
from django.utils.translation import ugettext as _
23+
1924
try:
2025
from django.urls import reverse
2126
except ImportError:

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
description="Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.",
99
author="Chris Sattinger",
1010
author_email="[email protected]",
11+
install_requires=["six"],
1112
url="https://github.com/crucialfelix/django-ajax-selects/",
1213
packages=["ajax_select"],
1314
package_data={

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
envlist =
99
{py27,py37}-flake8,
1010
{py27,py37}-{dj18,dj19,dj110,dj111}
11-
py37-{dj20,dj21}
11+
py37-{dj20,dj21,dj30}
1212

1313
[testenv]
1414
setenv =
@@ -22,6 +22,7 @@ deps =
2222
dj111: Django>=1.11.8,<1.12
2323
dj20: Django>=2.0,<2.1
2424
dj21: Django>=2.1,<2.2
25+
dj30: Django>=3,<3.1
2526
; djmaster: https://github.com/django/django/zipball/master
2627

2728
[testenv:py27-flake8]

0 commit comments

Comments
 (0)