aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorTom Christie2014-08-19 17:06:55 +0100
committerTom Christie2014-08-19 17:06:55 +0100
commit63d02dbea855a060ec4cdb194497188e2f40cb66 (patch)
tree6b928af2fb99cabf486bc15079db3cd831d8bf34 /rest_framework
parent00c0dfc66fd2426a63e6eec498395740b2c3e63b (diff)
downloaddjango-rest-framework-63d02dbea855a060ec4cdb194497188e2f40cb66.tar.bz2
Drop six from compat. 1.4.2 is now the lowest supported version.
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/compat.py7
-rw-r--r--rest_framework/decorators.py2
-rw-r--r--rest_framework/fields.py4
-rw-r--r--rest_framework/filters.py3
-rw-r--r--rest_framework/parsers.py3
-rw-r--r--rest_framework/renderers.py6
-rw-r--r--rest_framework/response.py2
-rw-r--r--rest_framework/serializers.py2
-rw-r--r--rest_framework/settings.py5
-rw-r--r--rest_framework/templatetags/rest_framework.py3
-rw-r--r--rest_framework/test.py3
11 files changed, 17 insertions, 23 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 4b16a8ca..fa0f0bfb 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -9,14 +9,9 @@ import django
import inspect
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
+from django.utils import six
-# Try to import six from Django, fallback to external `six` package.
-try:
- from django.utils import six
-except ImportError:
- import six
-
# Handle django.utils.encoding rename in 1.5 onwards.
# smart_unicode -> smart_text
# force_unicode -> force_text
diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py
index e06d6ff5..449ba0a2 100644
--- a/rest_framework/decorators.py
+++ b/rest_framework/decorators.py
@@ -7,7 +7,7 @@ based views, as well as the `@detail_route` and `@list_route` decorators, which
used to annotate methods on viewsets that should be included by routers.
"""
from __future__ import unicode_literals
-from rest_framework.compat import six
+from django.utils import six
from rest_framework.views import APIView
import types
import warnings
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 85fcbd96..9d707c9b 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -18,14 +18,14 @@ from django.conf import settings
from django.db.models.fields import BLANK_CHOICE_DASH
from django.http import QueryDict
from django.forms import widgets
-from django.utils import timezone
+from django.utils import six, timezone
from django.utils.encoding import is_protected_type
from django.utils.translation import ugettext_lazy as _
from django.utils.datastructures import SortedDict
from django.utils.dateparse import parse_date, parse_datetime, parse_time
from rest_framework import ISO_8601
from rest_framework.compat import (
- BytesIO, six, smart_text,
+ BytesIO, smart_text,
force_text, is_non_str_iterable
)
from rest_framework.settings import api_settings
diff --git a/rest_framework/filters.py b/rest_framework/filters.py
index 28927eec..e2080013 100644
--- a/rest_framework/filters.py
+++ b/rest_framework/filters.py
@@ -5,7 +5,8 @@ returned by list views.
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.db import models
-from rest_framework.compat import django_filters, six, guardian, get_model_name
+from django.utils import six
+from rest_framework.compat import django_filters, guardian, get_model_name
from rest_framework.settings import api_settings
from functools import reduce
import operator
diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py
index 4990971b..aa4fd3f1 100644
--- a/rest_framework/parsers.py
+++ b/rest_framework/parsers.py
@@ -10,7 +10,8 @@ from django.core.files.uploadhandler import StopFutureHandlers
from django.http import QueryDict
from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser
from django.http.multipartparser import MultiPartParserError, parse_header, ChunkIter
-from rest_framework.compat import etree, six, yaml, force_text
+from django.utils import six
+from rest_framework.compat import etree, yaml, force_text
from rest_framework.exceptions import ParseError
from rest_framework import renderers
import json
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py
index ac7175a7..748ebac9 100644
--- a/rest_framework/renderers.py
+++ b/rest_framework/renderers.py
@@ -15,11 +15,9 @@ from django.core.exceptions import ImproperlyConfigured
from django.http.multipartparser import parse_header
from django.template import RequestContext, loader, Template
from django.test.client import encode_multipart
+from django.utils import six
from django.utils.xmlutils import SimplerXMLGenerator
-from rest_framework.compat import StringIO
-from rest_framework.compat import six
-from rest_framework.compat import smart_text
-from rest_framework.compat import yaml
+from rest_framework.compat import StringIO, smart_text, yaml
from rest_framework.exceptions import ParseError
from rest_framework.settings import api_settings
from rest_framework.request import is_form_media_type, override_method
diff --git a/rest_framework/response.py b/rest_framework/response.py
index 80225cac..0a7d313f 100644
--- a/rest_framework/response.py
+++ b/rest_framework/response.py
@@ -8,7 +8,7 @@ from __future__ import unicode_literals
import django
from django.core.handlers.wsgi import STATUS_CODE_TEXT
from django.template.response import SimpleTemplateResponse
-from rest_framework.compat import six
+from django.utils import six
class Response(SimpleTemplateResponse):
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index 95288671..be8ad3f2 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -20,9 +20,9 @@ from django.contrib.contenttypes.generic import GenericForeignKey
from django.core.paginator import Page
from django.db import models
from django.forms import widgets
+from django.utils import six
from django.utils.datastructures import SortedDict
from django.core.exceptions import ObjectDoesNotExist
-from rest_framework.compat import six
from rest_framework.settings import api_settings
diff --git a/rest_framework/settings.py b/rest_framework/settings.py
index 6806a468..644751f8 100644
--- a/rest_framework/settings.py
+++ b/rest_framework/settings.py
@@ -18,12 +18,9 @@ REST framework settings, checking for user settings first, then falling
back to the defaults.
"""
from __future__ import unicode_literals
-
from django.conf import settings
-from django.utils import importlib
-
+from django.utils import importlib, six
from rest_framework import ISO_8601
-from rest_framework.compat import six
USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None)
diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py
index 9110aedb..b80a7d77 100644
--- a/rest_framework/templatetags/rest_framework.py
+++ b/rest_framework/templatetags/rest_framework.py
@@ -2,11 +2,12 @@ from __future__ import unicode_literals, absolute_import
from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.http import QueryDict
+from django.utils import six
from django.utils.encoding import iri_to_uri
from django.utils.html import escape
from django.utils.safestring import SafeData, mark_safe
-from rest_framework.compat import urlparse, force_text, six
from django.utils.html import smart_urlquote
+from rest_framework.compat import urlparse, force_text
import re
register = template.Library()
diff --git a/rest_framework/test.py b/rest_framework/test.py
index 9242cf7c..f89a6dcd 100644
--- a/rest_framework/test.py
+++ b/rest_framework/test.py
@@ -8,10 +8,11 @@ from django.conf import settings
from django.test.client import Client as DjangoClient
from django.test.client import ClientHandler
from django.test import testcases
+from django.utils import six
from django.utils.http import urlencode
from rest_framework.settings import api_settings
from rest_framework.compat import RequestFactory as DjangoRequestFactory
-from rest_framework.compat import force_bytes_or_smart_bytes, six
+from rest_framework.compat import force_bytes_or_smart_bytes
def force_authenticate(request, user=None, token=None):