Change python3 compatibility
This commit is contained in:
parent
3ab2dd9d38
commit
27851b8eb5
14
.travis.yml
14
.travis.yml
|
@ -60,6 +60,20 @@ matrix:
|
||||||
env: DJANGO_VERSION='Django>=1.9,<1.10'
|
env: DJANGO_VERSION='Django>=1.9,<1.10'
|
||||||
- python: "3.6"
|
- python: "3.6"
|
||||||
env: DJANGO_VERSION='Django>=1.10,<1.11'
|
env: DJANGO_VERSION='Django>=1.10,<1.11'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.4,<1.5'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.5,<1.6'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.6,<1.7'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.7,<1.8'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.8,<1.9'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.9,<1.10'
|
||||||
|
- python: "3.7"
|
||||||
|
env: DJANGO_VERSION='Django>=1.10,<1.11'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install -q $DJANGO_VERSION
|
- pip install -q $DJANGO_VERSION
|
||||||
|
|
|
@ -20,7 +20,6 @@ from django import VERSION
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.text import capfirst
|
from django.utils.text import capfirst
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
|
||||||
from django.core import exceptions
|
from django.core import exceptions
|
||||||
|
|
||||||
from ..forms.fields import MultiSelectFormField, MinChoicesValidator, MaxChoicesValidator
|
from ..forms.fields import MultiSelectFormField, MinChoicesValidator, MaxChoicesValidator
|
||||||
|
@ -47,7 +46,6 @@ def add_metaclass(metaclass):
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
|
||||||
class MSFList(list):
|
class MSFList(list):
|
||||||
|
|
||||||
def __init__(self, choices, *args, **kwargs):
|
def __init__(self, choices, *args, **kwargs):
|
||||||
|
@ -58,6 +56,10 @@ class MSFList(list):
|
||||||
msg_list = [msgl.choices.get(int(i)) if i.isdigit() else msgl.choices.get(i) for i in msgl]
|
msg_list = [msgl.choices.get(int(i)) if i.isdigit() else msgl.choices.get(i) for i in msgl]
|
||||||
return u', '.join([string_type(s) for s in msg_list])
|
return u', '.join([string_type(s) for s in msg_list])
|
||||||
|
|
||||||
|
if sys.version_info < (3,):
|
||||||
|
def __unicode__(self, msgl):
|
||||||
|
return self.__str__(msgl)
|
||||||
|
|
||||||
|
|
||||||
class MultiSelectField(models.CharField):
|
class MultiSelectField(models.CharField):
|
||||||
""" Choice values can not contain commas. """
|
""" Choice values can not contain commas. """
|
||||||
|
|
Loading…
Reference in a new issue