diff --git a/.tx/config b/.tx/config index 271fa1e35..849c6eb13 100644 --- a/.tx/config +++ b/.tx/config @@ -1,9 +1,9 @@ [main] host = https://www.transifex.com -[django-rest-framework.djangopo] -file_filter = rest_framework/locale//LC_MESSAGES/django.po -source_file = rest_framework/locale/en_US/LC_MESSAGES/django.po +[django-rest-framework-3.djangopo] +file_filter = rest_framework_3/locale//LC_MESSAGES/django.po +source_file = rest_framework_3/locale/en_US/LC_MESSAGES/django.po source_lang = en_US type = PO diff --git a/MANIFEST.in b/MANIFEST.in index d202c86ea..f982e137f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -recursive-include rest_framework/static *.js *.css *.png *.eot *.svg *.ttf *.woff -recursive-include rest_framework/templates *.html +recursive-include rest_framework_3/static *.js *.css *.png *.eot *.svg *.ttf *.woff +recursive-include rest_framework_3/templates *.html recursive-exclude * __pycache__ recursive-exclude * *.py[co] diff --git a/README.md b/README.md index 174537093..8f3d49aa2 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ Install using `pip`... pip install djangorestframework -Add `'rest_framework'` to your `INSTALLED_APPS` setting. +Add `'rest_framework_3'` to your `INSTALLED_APPS` setting. INSTALLED_APPS = ( ... - 'rest_framework', + 'rest_framework_3', ) # Example @@ -67,7 +67,7 @@ Now edit the `example/urls.py` module in your project: ```python from django.conf.urls import url, include from django.contrib.auth.models import User -from rest_framework import serializers, viewsets, routers +from rest_framework_3 import serializers, viewsets, routers # Serializers define the API representation. class UserSerializer(serializers.HyperlinkedModelSerializer): @@ -91,7 +91,7 @@ router.register(r'users', UserViewSet) # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), - url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) + url(r'^api-auth/', include('rest_framework_3.urls', namespace='rest_framework_3')) ] ``` @@ -102,14 +102,14 @@ Add the following to your `settings.py` module: ```python INSTALLED_APPS = ( ... # Make sure to include the default installed apps here. - 'rest_framework', + 'rest_framework_3', ) REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ - 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' + 'rest_framework_3.permissions.DjangoModelPermissionsOrAnonReadOnly' ] } ``` diff --git a/rest_framework/__init__.py b/rest_framework_3/__init__.py similarity index 100% rename from rest_framework/__init__.py rename to rest_framework_3/__init__.py diff --git a/rest_framework/authentication.py b/rest_framework_3/authentication.py similarity index 98% rename from rest_framework/authentication.py rename to rest_framework_3/authentication.py index f0702286c..3be35e73f 100644 --- a/rest_framework/authentication.py +++ b/rest_framework_3/authentication.py @@ -6,8 +6,8 @@ import base64 from django.contrib.auth import authenticate from django.middleware.csrf import CsrfViewMiddleware from django.utils.translation import ugettext_lazy as _ -from rest_framework import exceptions, HTTP_HEADER_ENCODING -from rest_framework.authtoken.models import Token +from rest_framework_3 import exceptions, HTTP_HEADER_ENCODING +from rest_framework_3.authtoken.models import Token def get_authorization_header(request): diff --git a/rest_framework/authtoken/__init__.py b/rest_framework_3/authtoken/__init__.py similarity index 100% rename from rest_framework/authtoken/__init__.py rename to rest_framework_3/authtoken/__init__.py diff --git a/rest_framework/authtoken/admin.py b/rest_framework_3/authtoken/admin.py similarity index 80% rename from rest_framework/authtoken/admin.py rename to rest_framework_3/authtoken/admin.py index ec28eb1ca..b76ca4a37 100644 --- a/rest_framework/authtoken/admin.py +++ b/rest_framework_3/authtoken/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from rest_framework.authtoken.models import Token +from rest_framework_3.authtoken.models import Token class TokenAdmin(admin.ModelAdmin): diff --git a/rest_framework/authtoken/migrations/0001_initial.py b/rest_framework_3/authtoken/migrations/0001_initial.py similarity index 100% rename from rest_framework/authtoken/migrations/0001_initial.py rename to rest_framework_3/authtoken/migrations/0001_initial.py diff --git a/rest_framework/authtoken/migrations/__init__.py b/rest_framework_3/authtoken/migrations/__init__.py similarity index 100% rename from rest_framework/authtoken/migrations/__init__.py rename to rest_framework_3/authtoken/migrations/__init__.py diff --git a/rest_framework/authtoken/models.py b/rest_framework_3/authtoken/models.py similarity index 94% rename from rest_framework/authtoken/models.py rename to rest_framework_3/authtoken/models.py index a1a9315fa..91bd7f6aa 100644 --- a/rest_framework/authtoken/models.py +++ b/rest_framework_3/authtoken/models.py @@ -28,7 +28,7 @@ class Token(models.Model): # # Also see corresponding ticket: # https://github.com/tomchristie/django-rest-framework/issues/705 - abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS + abstract = 'rest_framework_3.authtoken' not in settings.INSTALLED_APPS def save(self, *args, **kwargs): if not self.key: diff --git a/rest_framework/authtoken/serializers.py b/rest_framework_3/authtoken/serializers.py similarity index 94% rename from rest_framework/authtoken/serializers.py rename to rest_framework_3/authtoken/serializers.py index 597aeed22..3345e7ca5 100644 --- a/rest_framework/authtoken/serializers.py +++ b/rest_framework_3/authtoken/serializers.py @@ -1,7 +1,7 @@ from django.contrib.auth import authenticate from django.utils.translation import ugettext_lazy as _ -from rest_framework import exceptions, serializers +from rest_framework_3 import exceptions, serializers class AuthTokenSerializer(serializers.Serializer): diff --git a/rest_framework/authtoken/south_migrations/0001_initial.py b/rest_framework_3/authtoken/south_migrations/0001_initial.py similarity index 100% rename from rest_framework/authtoken/south_migrations/0001_initial.py rename to rest_framework_3/authtoken/south_migrations/0001_initial.py diff --git a/rest_framework/authtoken/south_migrations/__init__.py b/rest_framework_3/authtoken/south_migrations/__init__.py similarity index 100% rename from rest_framework/authtoken/south_migrations/__init__.py rename to rest_framework_3/authtoken/south_migrations/__init__.py diff --git a/rest_framework/authtoken/views.py b/rest_framework_3/authtoken/views.py similarity index 68% rename from rest_framework/authtoken/views.py rename to rest_framework_3/authtoken/views.py index 66bbc49b7..d4e4365e3 100644 --- a/rest_framework/authtoken/views.py +++ b/rest_framework_3/authtoken/views.py @@ -1,9 +1,9 @@ -from rest_framework.views import APIView -from rest_framework import parsers -from rest_framework import renderers -from rest_framework.response import Response -from rest_framework.authtoken.models import Token -from rest_framework.authtoken.serializers import AuthTokenSerializer +from rest_framework_3.views import APIView +from rest_framework_3 import parsers +from rest_framework_3 import renderers +from rest_framework_3.response import Response +from rest_framework_3.authtoken.models import Token +from rest_framework_3.authtoken.serializers import AuthTokenSerializer class ObtainAuthToken(APIView): diff --git a/rest_framework/compat.py b/rest_framework_3/compat.py similarity index 100% rename from rest_framework/compat.py rename to rest_framework_3/compat.py diff --git a/rest_framework/decorators.py b/rest_framework_3/decorators.py similarity index 99% rename from rest_framework/decorators.py rename to rest_framework_3/decorators.py index 21de1acf4..8a8f3c46b 100644 --- a/rest_framework/decorators.py +++ b/rest_framework_3/decorators.py @@ -8,7 +8,7 @@ used to annotate methods on viewsets that should be included by routers. """ from __future__ import unicode_literals from django.utils import six -from rest_framework.views import APIView +from rest_framework_3.views import APIView import types diff --git a/rest_framework/exceptions.py b/rest_framework_3/exceptions.py similarity index 98% rename from rest_framework/exceptions.py rename to rest_framework_3/exceptions.py index f954c13e5..6388bb294 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework_3/exceptions.py @@ -8,7 +8,7 @@ from __future__ import unicode_literals from django.utils import six from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _, ungettext -from rest_framework import status +from rest_framework_3 import status import math @@ -51,7 +51,7 @@ class APIException(Exception): # under `serializers`, in order to minimize potential confusion with Django's # built in `ValidationError`. For example: # -# from rest_framework import serializers +# from rest_framework_3 import serializers # raise serializers.ValidationError('Value was invalid') class ValidationError(APIException): diff --git a/rest_framework/fields.py b/rest_framework_3/fields.py similarity index 99% rename from rest_framework/fields.py rename to rest_framework_3/fields.py index 68835bded..a6dd59e6e 100644 --- a/rest_framework/fields.py +++ b/rest_framework_3/fields.py @@ -8,15 +8,15 @@ from django.utils import six, timezone from django.utils.dateparse import parse_date, parse_datetime, parse_time from django.utils.encoding import is_protected_type, smart_text from django.utils.translation import ugettext_lazy as _ -from rest_framework import ISO_8601 -from rest_framework.compat import ( +from rest_framework_3 import ISO_8601 +from rest_framework_3.compat import ( EmailValidator, MinValueValidator, MaxValueValidator, MinLengthValidator, MaxLengthValidator, URLValidator, OrderedDict, unicode_repr, unicode_to_repr ) -from rest_framework.exceptions import ValidationError -from rest_framework.settings import api_settings -from rest_framework.utils import html, representation, humanize_datetime +from rest_framework_3.exceptions import ValidationError +from rest_framework_3.settings import api_settings +from rest_framework_3.utils import html, representation, humanize_datetime import collections import copy import datetime diff --git a/rest_framework/filters.py b/rest_framework_3/filters.py similarity index 98% rename from rest_framework/filters.py rename to rest_framework_3/filters.py index 9a84efa23..1a9aeb4f1 100644 --- a/rest_framework/filters.py +++ b/rest_framework_3/filters.py @@ -7,8 +7,8 @@ from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils import six -from rest_framework.compat import django_filters, guardian, get_model_name -from rest_framework.settings import api_settings +from rest_framework_3.compat import django_filters, guardian, get_model_name +from rest_framework_3.settings import api_settings from functools import reduce import operator diff --git a/rest_framework/generics.py b/rest_framework_3/generics.py similarity index 99% rename from rest_framework/generics.py rename to rest_framework_3/generics.py index 61dcb84a4..216f708fe 100644 --- a/rest_framework/generics.py +++ b/rest_framework_3/generics.py @@ -5,8 +5,8 @@ from __future__ import unicode_literals from django.db.models.query import QuerySet from django.http import Http404 from django.shortcuts import get_object_or_404 as _get_object_or_404 -from rest_framework import views, mixins -from rest_framework.settings import api_settings +from rest_framework_3 import views, mixins +from rest_framework_3.settings import api_settings def get_object_or_404(queryset, *filter_args, **filter_kwargs): diff --git a/rest_framework/locale/ar/LC_MESSAGES/django.mo b/rest_framework_3/locale/ar/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/ar/LC_MESSAGES/django.mo rename to rest_framework_3/locale/ar/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/ar/LC_MESSAGES/django.po b/rest_framework_3/locale/ar/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/ar/LC_MESSAGES/django.po rename to rest_framework_3/locale/ar/LC_MESSAGES/django.po diff --git a/rest_framework/locale/cs/LC_MESSAGES/django.mo b/rest_framework_3/locale/cs/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/cs/LC_MESSAGES/django.mo rename to rest_framework_3/locale/cs/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/cs/LC_MESSAGES/django.po b/rest_framework_3/locale/cs/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/cs/LC_MESSAGES/django.po rename to rest_framework_3/locale/cs/LC_MESSAGES/django.po diff --git a/rest_framework/locale/da/LC_MESSAGES/django.mo b/rest_framework_3/locale/da/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/da/LC_MESSAGES/django.mo rename to rest_framework_3/locale/da/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/da/LC_MESSAGES/django.po b/rest_framework_3/locale/da/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/da/LC_MESSAGES/django.po rename to rest_framework_3/locale/da/LC_MESSAGES/django.po diff --git a/rest_framework/locale/de/LC_MESSAGES/django.mo b/rest_framework_3/locale/de/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/de/LC_MESSAGES/django.mo rename to rest_framework_3/locale/de/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/de/LC_MESSAGES/django.po b/rest_framework_3/locale/de/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/de/LC_MESSAGES/django.po rename to rest_framework_3/locale/de/LC_MESSAGES/django.po diff --git a/rest_framework/locale/en/LC_MESSAGES/django.mo b/rest_framework_3/locale/en/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/en/LC_MESSAGES/django.mo rename to rest_framework_3/locale/en/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/en/LC_MESSAGES/django.po b/rest_framework_3/locale/en/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/en/LC_MESSAGES/django.po rename to rest_framework_3/locale/en/LC_MESSAGES/django.po diff --git a/rest_framework/locale/en_US/LC_MESSAGES/django.mo b/rest_framework_3/locale/en_US/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/en_US/LC_MESSAGES/django.mo rename to rest_framework_3/locale/en_US/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/en_US/LC_MESSAGES/django.po b/rest_framework_3/locale/en_US/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/en_US/LC_MESSAGES/django.po rename to rest_framework_3/locale/en_US/LC_MESSAGES/django.po diff --git a/rest_framework/locale/es/LC_MESSAGES/django.mo b/rest_framework_3/locale/es/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/es/LC_MESSAGES/django.mo rename to rest_framework_3/locale/es/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/es/LC_MESSAGES/django.po b/rest_framework_3/locale/es/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/es/LC_MESSAGES/django.po rename to rest_framework_3/locale/es/LC_MESSAGES/django.po diff --git a/rest_framework/locale/et/LC_MESSAGES/django.mo b/rest_framework_3/locale/et/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/et/LC_MESSAGES/django.mo rename to rest_framework_3/locale/et/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/et/LC_MESSAGES/django.po b/rest_framework_3/locale/et/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/et/LC_MESSAGES/django.po rename to rest_framework_3/locale/et/LC_MESSAGES/django.po diff --git a/rest_framework/locale/fr/LC_MESSAGES/django.mo b/rest_framework_3/locale/fr/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/fr/LC_MESSAGES/django.mo rename to rest_framework_3/locale/fr/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/fr/LC_MESSAGES/django.po b/rest_framework_3/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/fr/LC_MESSAGES/django.po rename to rest_framework_3/locale/fr/LC_MESSAGES/django.po diff --git a/rest_framework/locale/hu/LC_MESSAGES/django.mo b/rest_framework_3/locale/hu/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/hu/LC_MESSAGES/django.mo rename to rest_framework_3/locale/hu/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/hu/LC_MESSAGES/django.po b/rest_framework_3/locale/hu/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/hu/LC_MESSAGES/django.po rename to rest_framework_3/locale/hu/LC_MESSAGES/django.po diff --git a/rest_framework/locale/id/LC_MESSAGES/django.mo b/rest_framework_3/locale/id/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/id/LC_MESSAGES/django.mo rename to rest_framework_3/locale/id/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/id/LC_MESSAGES/django.po b/rest_framework_3/locale/id/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/id/LC_MESSAGES/django.po rename to rest_framework_3/locale/id/LC_MESSAGES/django.po diff --git a/rest_framework/locale/it/LC_MESSAGES/django.mo b/rest_framework_3/locale/it/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/it/LC_MESSAGES/django.mo rename to rest_framework_3/locale/it/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/it/LC_MESSAGES/django.po b/rest_framework_3/locale/it/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/it/LC_MESSAGES/django.po rename to rest_framework_3/locale/it/LC_MESSAGES/django.po diff --git a/rest_framework/locale/ko_KR/LC_MESSAGES/django.mo b/rest_framework_3/locale/ko_KR/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/ko_KR/LC_MESSAGES/django.mo rename to rest_framework_3/locale/ko_KR/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/ko_KR/LC_MESSAGES/django.po b/rest_framework_3/locale/ko_KR/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/ko_KR/LC_MESSAGES/django.po rename to rest_framework_3/locale/ko_KR/LC_MESSAGES/django.po diff --git a/rest_framework/locale/mk/LC_MESSAGES/django.mo b/rest_framework_3/locale/mk/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/mk/LC_MESSAGES/django.mo rename to rest_framework_3/locale/mk/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/mk/LC_MESSAGES/django.po b/rest_framework_3/locale/mk/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/mk/LC_MESSAGES/django.po rename to rest_framework_3/locale/mk/LC_MESSAGES/django.po diff --git a/rest_framework/locale/nl/LC_MESSAGES/django.mo b/rest_framework_3/locale/nl/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/nl/LC_MESSAGES/django.mo rename to rest_framework_3/locale/nl/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/nl/LC_MESSAGES/django.po b/rest_framework_3/locale/nl/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/nl/LC_MESSAGES/django.po rename to rest_framework_3/locale/nl/LC_MESSAGES/django.po diff --git a/rest_framework/locale/pl/LC_MESSAGES/django.mo b/rest_framework_3/locale/pl/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/pl/LC_MESSAGES/django.mo rename to rest_framework_3/locale/pl/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/pl/LC_MESSAGES/django.po b/rest_framework_3/locale/pl/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/pl/LC_MESSAGES/django.po rename to rest_framework_3/locale/pl/LC_MESSAGES/django.po diff --git a/rest_framework/locale/pt_BR/LC_MESSAGES/django.mo b/rest_framework_3/locale/pt_BR/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/pt_BR/LC_MESSAGES/django.mo rename to rest_framework_3/locale/pt_BR/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/pt_BR/LC_MESSAGES/django.po b/rest_framework_3/locale/pt_BR/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/pt_BR/LC_MESSAGES/django.po rename to rest_framework_3/locale/pt_BR/LC_MESSAGES/django.po diff --git a/rest_framework/locale/pt_PT/LC_MESSAGES/django.mo b/rest_framework_3/locale/pt_PT/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/pt_PT/LC_MESSAGES/django.mo rename to rest_framework_3/locale/pt_PT/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/pt_PT/LC_MESSAGES/django.po b/rest_framework_3/locale/pt_PT/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/pt_PT/LC_MESSAGES/django.po rename to rest_framework_3/locale/pt_PT/LC_MESSAGES/django.po diff --git a/rest_framework/locale/ru/LC_MESSAGES/django.mo b/rest_framework_3/locale/ru/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/ru/LC_MESSAGES/django.mo rename to rest_framework_3/locale/ru/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/ru/LC_MESSAGES/django.po b/rest_framework_3/locale/ru/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/ru/LC_MESSAGES/django.po rename to rest_framework_3/locale/ru/LC_MESSAGES/django.po diff --git a/rest_framework/locale/sk/LC_MESSAGES/django.mo b/rest_framework_3/locale/sk/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/sk/LC_MESSAGES/django.mo rename to rest_framework_3/locale/sk/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/sk/LC_MESSAGES/django.po b/rest_framework_3/locale/sk/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/sk/LC_MESSAGES/django.po rename to rest_framework_3/locale/sk/LC_MESSAGES/django.po diff --git a/rest_framework/locale/sv/LC_MESSAGES/django.mo b/rest_framework_3/locale/sv/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/sv/LC_MESSAGES/django.mo rename to rest_framework_3/locale/sv/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/sv/LC_MESSAGES/django.po b/rest_framework_3/locale/sv/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/sv/LC_MESSAGES/django.po rename to rest_framework_3/locale/sv/LC_MESSAGES/django.po diff --git a/rest_framework/locale/tr/LC_MESSAGES/django.mo b/rest_framework_3/locale/tr/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/tr/LC_MESSAGES/django.mo rename to rest_framework_3/locale/tr/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/tr/LC_MESSAGES/django.po b/rest_framework_3/locale/tr/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/tr/LC_MESSAGES/django.po rename to rest_framework_3/locale/tr/LC_MESSAGES/django.po diff --git a/rest_framework/locale/uk/LC_MESSAGES/django.mo b/rest_framework_3/locale/uk/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/uk/LC_MESSAGES/django.mo rename to rest_framework_3/locale/uk/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/uk/LC_MESSAGES/django.po b/rest_framework_3/locale/uk/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/uk/LC_MESSAGES/django.po rename to rest_framework_3/locale/uk/LC_MESSAGES/django.po diff --git a/rest_framework/locale/vi/LC_MESSAGES/django.mo b/rest_framework_3/locale/vi/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/vi/LC_MESSAGES/django.mo rename to rest_framework_3/locale/vi/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/vi/LC_MESSAGES/django.po b/rest_framework_3/locale/vi/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/vi/LC_MESSAGES/django.po rename to rest_framework_3/locale/vi/LC_MESSAGES/django.po diff --git a/rest_framework/locale/zh_CN/LC_MESSAGES/django.mo b/rest_framework_3/locale/zh_CN/LC_MESSAGES/django.mo similarity index 100% rename from rest_framework/locale/zh_CN/LC_MESSAGES/django.mo rename to rest_framework_3/locale/zh_CN/LC_MESSAGES/django.mo diff --git a/rest_framework/locale/zh_CN/LC_MESSAGES/django.po b/rest_framework_3/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from rest_framework/locale/zh_CN/LC_MESSAGES/django.po rename to rest_framework_3/locale/zh_CN/LC_MESSAGES/django.po diff --git a/rest_framework/metadata.py b/rest_framework_3/metadata.py similarity index 95% rename from rest_framework/metadata.py rename to rest_framework_3/metadata.py index b2c48b816..7df012157 100644 --- a/rest_framework/metadata.py +++ b/rest_framework_3/metadata.py @@ -11,10 +11,10 @@ from __future__ import unicode_literals from django.core.exceptions import PermissionDenied from django.http import Http404 from django.utils.encoding import force_text -from rest_framework import exceptions, serializers -from rest_framework.compat import OrderedDict -from rest_framework.request import clone_request -from rest_framework.utils.field_mapping import ClassLookupDict +from rest_framework_3 import exceptions, serializers +from rest_framework_3.compat import OrderedDict +from rest_framework_3.request import clone_request +from rest_framework_3.utils.field_mapping import ClassLookupDict class BaseMetadata(object): diff --git a/rest_framework/mixins.py b/rest_framework_3/mixins.py similarity index 95% rename from rest_framework/mixins.py rename to rest_framework_3/mixins.py index c34cfcee1..1fbca422e 100644 --- a/rest_framework/mixins.py +++ b/rest_framework_3/mixins.py @@ -5,9 +5,9 @@ We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from __future__ import unicode_literals -from rest_framework import status -from rest_framework.response import Response -from rest_framework.settings import api_settings +from rest_framework_3 import status +from rest_framework_3.response import Response +from rest_framework_3.settings import api_settings class CreateModelMixin(object): diff --git a/rest_framework/models.py b/rest_framework_3/models.py similarity index 100% rename from rest_framework/models.py rename to rest_framework_3/models.py diff --git a/rest_framework/negotiation.py b/rest_framework_3/negotiation.py similarity index 94% rename from rest_framework/negotiation.py rename to rest_framework_3/negotiation.py index 663ec4c8a..f6da13159 100644 --- a/rest_framework/negotiation.py +++ b/rest_framework_3/negotiation.py @@ -4,10 +4,10 @@ incoming request. Typically this will be based on the request's Accept header. """ from __future__ import unicode_literals from django.http import Http404 -from rest_framework import HTTP_HEADER_ENCODING, exceptions -from rest_framework.settings import api_settings -from rest_framework.utils.mediatypes import order_by_precedence, media_type_matches -from rest_framework.utils.mediatypes import _MediaType +from rest_framework_3 import HTTP_HEADER_ENCODING, exceptions +from rest_framework_3.settings import api_settings +from rest_framework_3.utils.mediatypes import order_by_precedence, media_type_matches +from rest_framework_3.utils.mediatypes import _MediaType class BaseContentNegotiation(object): diff --git a/rest_framework/pagination.py b/rest_framework_3/pagination.py similarity index 99% rename from rest_framework/pagination.py rename to rest_framework_3/pagination.py index b6be6b7cc..73cfcbfb0 100644 --- a/rest_framework/pagination.py +++ b/rest_framework_3/pagination.py @@ -11,11 +11,11 @@ from django.template import Context, loader from django.utils import six from django.utils.six.moves.urllib import parse as urlparse from django.utils.translation import ugettext_lazy as _ -from rest_framework.compat import OrderedDict -from rest_framework.exceptions import NotFound -from rest_framework.response import Response -from rest_framework.settings import api_settings -from rest_framework.utils.urls import ( +from rest_framework_3.compat import OrderedDict +from rest_framework_3.exceptions import NotFound +from rest_framework_3.response import Response +from rest_framework_3.settings import api_settings +from rest_framework_3.utils.urls import ( replace_query_param, remove_query_param ) import warnings diff --git a/rest_framework/parsers.py b/rest_framework_3/parsers.py similarity index 98% rename from rest_framework/parsers.py rename to rest_framework_3/parsers.py index 437d13392..7114e6077 100644 --- a/rest_framework/parsers.py +++ b/rest_framework_3/parsers.py @@ -14,8 +14,8 @@ from django.http.multipartparser import MultiPartParserError, parse_header, Chun from django.utils import six from django.utils.six.moves.urllib import parse as urlparse from django.utils.encoding import force_text -from rest_framework.exceptions import ParseError -from rest_framework import renderers +from rest_framework_3.exceptions import ParseError +from rest_framework_3 import renderers import json diff --git a/rest_framework/permissions.py b/rest_framework_3/permissions.py similarity index 99% rename from rest_framework/permissions.py rename to rest_framework_3/permissions.py index 8fa7e4452..6e4f7f335 100644 --- a/rest_framework/permissions.py +++ b/rest_framework_3/permissions.py @@ -3,7 +3,7 @@ Provides a set of pluggable permission policies. """ from __future__ import unicode_literals from django.http import Http404 -from rest_framework.compat import get_model_name +from rest_framework_3.compat import get_model_name SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS') diff --git a/rest_framework/relations.py b/rest_framework_3/relations.py similarity index 98% rename from rest_framework/relations.py rename to rest_framework_3/relations.py index 00a4a2656..f2d339373 100644 --- a/rest_framework/relations.py +++ b/rest_framework_3/relations.py @@ -7,10 +7,10 @@ from django.utils import six from django.utils.encoding import smart_text from django.utils.six.moves.urllib import parse as urlparse from django.utils.translation import ugettext_lazy as _ -from rest_framework.compat import OrderedDict -from rest_framework.fields import get_attribute, empty, Field -from rest_framework.reverse import reverse -from rest_framework.utils import html +from rest_framework_3.compat import OrderedDict +from rest_framework_3.fields import get_attribute, empty, Field +from rest_framework_3.reverse import reverse +from rest_framework_3.utils import html class PKOnlyObject(object): diff --git a/rest_framework/renderers.py b/rest_framework_3/renderers.py similarity index 98% rename from rest_framework/renderers.py rename to rest_framework_3/renderers.py index 6c7cdf537..7d6044535 100644 --- a/rest_framework/renderers.py +++ b/rest_framework_3/renderers.py @@ -17,14 +17,14 @@ from django.http.multipartparser import parse_header from django.template import Context, RequestContext, loader, Template from django.test.client import encode_multipart from django.utils import six -from rest_framework import exceptions, serializers, status, VERSION -from rest_framework.compat import SHORT_SEPARATORS, LONG_SEPARATORS, INDENT_SEPARATORS -from rest_framework.exceptions import ParseError -from rest_framework.settings import api_settings -from rest_framework.request import is_form_media_type, override_method -from rest_framework.utils import encoders -from rest_framework.utils.breadcrumbs import get_breadcrumbs -from rest_framework.utils.field_mapping import ClassLookupDict +from rest_framework_3 import exceptions, serializers, status, VERSION +from rest_framework_3.compat import SHORT_SEPARATORS, LONG_SEPARATORS, INDENT_SEPARATORS +from rest_framework_3.exceptions import ParseError +from rest_framework_3.settings import api_settings +from rest_framework_3.request import is_form_media_type, override_method +from rest_framework_3.utils import encoders +from rest_framework_3.utils.breadcrumbs import get_breadcrumbs +from rest_framework_3.utils.field_mapping import ClassLookupDict def zero_as_none(value): diff --git a/rest_framework/request.py b/rest_framework_3/request.py similarity index 99% rename from rest_framework/request.py rename to rest_framework_3/request.py index e4b5bc263..4c6c3fcca 100644 --- a/rest_framework/request.py +++ b/rest_framework_3/request.py @@ -14,9 +14,9 @@ from django.http import QueryDict from django.http.multipartparser import parse_header from django.utils import six from django.utils.datastructures import MultiValueDict -from rest_framework import HTTP_HEADER_ENCODING -from rest_framework import exceptions -from rest_framework.settings import api_settings +from rest_framework_3 import HTTP_HEADER_ENCODING +from rest_framework_3 import exceptions +from rest_framework_3.settings import api_settings import sys import warnings diff --git a/rest_framework/response.py b/rest_framework_3/response.py similarity index 100% rename from rest_framework/response.py rename to rest_framework_3/response.py diff --git a/rest_framework/reverse.py b/rest_framework_3/reverse.py similarity index 100% rename from rest_framework/reverse.py rename to rest_framework_3/reverse.py diff --git a/rest_framework/routers.py b/rest_framework_3/routers.py similarity index 97% rename from rest_framework/routers.py rename to rest_framework_3/routers.py index 4df852bfb..e6038f6be 100644 --- a/rest_framework/routers.py +++ b/rest_framework_3/routers.py @@ -20,11 +20,11 @@ from collections import namedtuple from django.conf.urls import patterns, url from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import NoReverseMatch -from rest_framework import views -from rest_framework.compat import get_resolver_match, OrderedDict -from rest_framework.response import Response -from rest_framework.reverse import reverse -from rest_framework.urlpatterns import format_suffix_patterns +from rest_framework_3 import views +from rest_framework_3.compat import get_resolver_match, OrderedDict +from rest_framework_3.response import Response +from rest_framework_3.reverse import reverse +from rest_framework_3.urlpatterns import format_suffix_patterns Route = namedtuple('Route', ['url', 'mapping', 'name', 'initkwargs']) diff --git a/rest_framework/serializers.py b/rest_framework_3/serializers.py similarity index 99% rename from rest_framework/serializers.py rename to rest_framework_3/serializers.py index 8e1e50bc7..6da1f48cf 100644 --- a/rest_framework/serializers.py +++ b/rest_framework_3/serializers.py @@ -15,17 +15,17 @@ from django.db import models from django.db.models.fields import FieldDoesNotExist, Field as DjangoModelField from django.db.models import query from django.utils.translation import ugettext_lazy as _ -from rest_framework.compat import postgres_fields, unicode_to_repr -from rest_framework.utils import model_meta -from rest_framework.utils.field_mapping import ( +from rest_framework_3.compat import postgres_fields, unicode_to_repr +from rest_framework_3.utils import model_meta +from rest_framework_3.utils.field_mapping import ( get_url_kwargs, get_field_kwargs, get_relation_kwargs, get_nested_relation_kwargs, ClassLookupDict ) -from rest_framework.utils.serializer_helpers import ( +from rest_framework_3.utils.serializer_helpers import ( ReturnDict, ReturnList, BoundField, NestedBoundField, BindingDict ) -from rest_framework.validators import ( +from rest_framework_3.validators import ( UniqueForDateValidator, UniqueForMonthValidator, UniqueForYearValidator, UniqueTogetherValidator ) @@ -39,8 +39,8 @@ import warnings # This helps keep the separation between model fields, form fields, and # serializer fields more explicit. -from rest_framework.relations import * # NOQA -from rest_framework.fields import * # NOQA +from rest_framework_3.relations import * # NOQA +from rest_framework_3.fields import * # NOQA # We assume that 'validators' are intended for the child serializer, diff --git a/rest_framework/settings.py b/rest_framework_3/settings.py similarity index 78% rename from rest_framework/settings.py rename to rest_framework_3/settings.py index a3e9f5902..dd9f2707c 100644 --- a/rest_framework/settings.py +++ b/rest_framework_3/settings.py @@ -4,12 +4,12 @@ For example your project's `settings.py` file might look like this: REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( - 'rest_framework.renderers.JSONRenderer', - 'rest_framework.renderers.TemplateHTMLRenderer', + 'rest_framework_3.renderers.JSONRenderer', + 'rest_framework_3.renderers.TemplateHTMLRenderer', ) 'DEFAULT_PARSER_CLASSES': ( - 'rest_framework.parsers.JSONParser', - 'rest_framework.parsers.TemplateHTMLRenderer', + 'rest_framework_3.parsers.JSONParser', + 'rest_framework_3.parsers.TemplateHTMLRenderer', ) } @@ -21,36 +21,36 @@ from __future__ import unicode_literals from django.test.signals import setting_changed from django.conf import settings from django.utils import six -from rest_framework import ISO_8601 -from rest_framework.compat import importlib +from rest_framework_3 import ISO_8601 +from rest_framework_3.compat import importlib -USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None) +USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK_3', None) DEFAULTS = { # Base API policies 'DEFAULT_RENDERER_CLASSES': ( - 'rest_framework.renderers.JSONRenderer', - 'rest_framework.renderers.BrowsableAPIRenderer', + 'rest_framework_3.renderers.JSONRenderer', + 'rest_framework_3.renderers.BrowsableAPIRenderer', ), 'DEFAULT_PARSER_CLASSES': ( - 'rest_framework.parsers.JSONParser', - 'rest_framework.parsers.FormParser', - 'rest_framework.parsers.MultiPartParser' + 'rest_framework_3.parsers.JSONParser', + 'rest_framework_3.parsers.FormParser', + 'rest_framework_3.parsers.MultiPartParser' ), 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework.authentication.SessionAuthentication', - 'rest_framework.authentication.BasicAuthentication' + 'rest_framework_3.authentication.SessionAuthentication', + 'rest_framework_3.authentication.BasicAuthentication' ), 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.AllowAny', + 'rest_framework_3.permissions.AllowAny', ), 'DEFAULT_THROTTLE_CLASSES': (), - 'DEFAULT_CONTENT_NEGOTIATION_CLASS': 'rest_framework.negotiation.DefaultContentNegotiation', - 'DEFAULT_METADATA_CLASS': 'rest_framework.metadata.SimpleMetadata', + 'DEFAULT_CONTENT_NEGOTIATION_CLASS': 'rest_framework_3.negotiation.DefaultContentNegotiation', + 'DEFAULT_METADATA_CLASS': 'rest_framework_3.metadata.SimpleMetadata', 'DEFAULT_VERSIONING_CLASS': None, # Generic view behavior - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', + 'DEFAULT_PAGINATION_CLASS': 'rest_framework_3.pagination.PageNumberPagination', 'DEFAULT_FILTER_BACKENDS': (), # Throttling @@ -77,17 +77,17 @@ DEFAULTS = { 'UNAUTHENTICATED_TOKEN': None, # View configuration - 'VIEW_NAME_FUNCTION': 'rest_framework.views.get_view_name', - 'VIEW_DESCRIPTION_FUNCTION': 'rest_framework.views.get_view_description', + 'VIEW_NAME_FUNCTION': 'rest_framework_3.views.get_view_name', + 'VIEW_DESCRIPTION_FUNCTION': 'rest_framework_3.views.get_view_description', # Exception handling - 'EXCEPTION_HANDLER': 'rest_framework.views.exception_handler', + 'EXCEPTION_HANDLER': 'rest_framework_3.views.exception_handler', 'NON_FIELD_ERRORS_KEY': 'non_field_errors', # Testing 'TEST_REQUEST_RENDERER_CLASSES': ( - 'rest_framework.renderers.MultiPartRenderer', - 'rest_framework.renderers.JSONRenderer' + 'rest_framework_3.renderers.MultiPartRenderer', + 'rest_framework_3.renderers.JSONRenderer' ), 'TEST_REQUEST_DEFAULT_FORMAT': 'multipart', @@ -179,7 +179,7 @@ class APISettings(object): A settings object, that allows API settings to be accessed as properties. For example: - from rest_framework.settings import api_settings + from rest_framework_3.settings import api_settings print(api_settings.DEFAULT_RENDERER_CLASSES) Any setting with string import paths will be automatically resolved @@ -216,7 +216,7 @@ api_settings = APISettings(USER_SETTINGS, DEFAULTS, IMPORT_STRINGS) def reload_api_settings(*args, **kwargs): global api_settings setting, value = kwargs['setting'], kwargs['value'] - if setting == 'REST_FRAMEWORK': + if setting == 'REST_FRAMEWORK_3': api_settings = APISettings(value, DEFAULTS, IMPORT_STRINGS) diff --git a/rest_framework/static/rest_framework/css/bootstrap-tweaks.css b/rest_framework_3/static/rest_framework/css/bootstrap-tweaks.css similarity index 100% rename from rest_framework/static/rest_framework/css/bootstrap-tweaks.css rename to rest_framework_3/static/rest_framework/css/bootstrap-tweaks.css diff --git a/rest_framework/static/rest_framework/css/bootstrap.min.css b/rest_framework_3/static/rest_framework/css/bootstrap.min.css similarity index 100% rename from rest_framework/static/rest_framework/css/bootstrap.min.css rename to rest_framework_3/static/rest_framework/css/bootstrap.min.css diff --git a/rest_framework/static/rest_framework/css/default.css b/rest_framework_3/static/rest_framework/css/default.css similarity index 100% rename from rest_framework/static/rest_framework/css/default.css rename to rest_framework_3/static/rest_framework/css/default.css diff --git a/rest_framework/static/rest_framework/css/prettify.css b/rest_framework_3/static/rest_framework/css/prettify.css similarity index 100% rename from rest_framework/static/rest_framework/css/prettify.css rename to rest_framework_3/static/rest_framework/css/prettify.css diff --git a/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.eot b/rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.eot rename to rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.eot diff --git a/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.svg b/rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.svg rename to rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.svg diff --git a/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.ttf b/rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.ttf rename to rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.ttf diff --git a/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff b/rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff rename to rest_framework_3/static/rest_framework/fonts/glyphicons-halflings-regular.woff diff --git a/rest_framework/static/rest_framework/img/glyphicons-halflings-white.png b/rest_framework_3/static/rest_framework/img/glyphicons-halflings-white.png similarity index 100% rename from rest_framework/static/rest_framework/img/glyphicons-halflings-white.png rename to rest_framework_3/static/rest_framework/img/glyphicons-halflings-white.png diff --git a/rest_framework/static/rest_framework/img/glyphicons-halflings.png b/rest_framework_3/static/rest_framework/img/glyphicons-halflings.png similarity index 100% rename from rest_framework/static/rest_framework/img/glyphicons-halflings.png rename to rest_framework_3/static/rest_framework/img/glyphicons-halflings.png diff --git a/rest_framework/static/rest_framework/img/grid.png b/rest_framework_3/static/rest_framework/img/grid.png similarity index 100% rename from rest_framework/static/rest_framework/img/grid.png rename to rest_framework_3/static/rest_framework/img/grid.png diff --git a/rest_framework/static/rest_framework/js/bootstrap.min.js b/rest_framework_3/static/rest_framework/js/bootstrap.min.js similarity index 100% rename from rest_framework/static/rest_framework/js/bootstrap.min.js rename to rest_framework_3/static/rest_framework/js/bootstrap.min.js diff --git a/rest_framework/static/rest_framework/js/default.js b/rest_framework_3/static/rest_framework/js/default.js similarity index 100% rename from rest_framework/static/rest_framework/js/default.js rename to rest_framework_3/static/rest_framework/js/default.js diff --git a/rest_framework/static/rest_framework/js/jquery-1.8.1-min.js b/rest_framework_3/static/rest_framework/js/jquery-1.8.1-min.js similarity index 100% rename from rest_framework/static/rest_framework/js/jquery-1.8.1-min.js rename to rest_framework_3/static/rest_framework/js/jquery-1.8.1-min.js diff --git a/rest_framework/static/rest_framework/js/prettify-min.js b/rest_framework_3/static/rest_framework/js/prettify-min.js similarity index 100% rename from rest_framework/static/rest_framework/js/prettify-min.js rename to rest_framework_3/static/rest_framework/js/prettify-min.js diff --git a/rest_framework/status.py b/rest_framework_3/status.py similarity index 100% rename from rest_framework/status.py rename to rest_framework_3/status.py diff --git a/rest_framework/templates/rest_framework/api.html b/rest_framework_3/templates/rest_framework_3/api.html similarity index 100% rename from rest_framework/templates/rest_framework/api.html rename to rest_framework_3/templates/rest_framework_3/api.html diff --git a/rest_framework/templates/rest_framework/api_form.html b/rest_framework_3/templates/rest_framework_3/api_form.html similarity index 100% rename from rest_framework/templates/rest_framework/api_form.html rename to rest_framework_3/templates/rest_framework_3/api_form.html diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework_3/templates/rest_framework_3/base.html similarity index 100% rename from rest_framework/templates/rest_framework/base.html rename to rest_framework_3/templates/rest_framework_3/base.html diff --git a/rest_framework/templates/rest_framework/horizontal/checkbox.html b/rest_framework_3/templates/rest_framework_3/horizontal/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/checkbox.html rename to rest_framework_3/templates/rest_framework_3/horizontal/checkbox.html diff --git a/rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html b/rest_framework_3/templates/rest_framework_3/horizontal/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html rename to rest_framework_3/templates/rest_framework_3/horizontal/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/horizontal/fieldset.html b/rest_framework_3/templates/rest_framework_3/horizontal/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fieldset.html rename to rest_framework_3/templates/rest_framework_3/horizontal/fieldset.html diff --git a/rest_framework/templates/rest_framework/horizontal/form.html b/rest_framework_3/templates/rest_framework_3/horizontal/form.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/form.html rename to rest_framework_3/templates/rest_framework_3/horizontal/form.html diff --git a/rest_framework/templates/rest_framework/horizontal/input.html b/rest_framework_3/templates/rest_framework_3/horizontal/input.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/input.html rename to rest_framework_3/templates/rest_framework_3/horizontal/input.html diff --git a/rest_framework/templates/rest_framework/horizontal/list_fieldset.html b/rest_framework_3/templates/rest_framework_3/horizontal/list_fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/list_fieldset.html rename to rest_framework_3/templates/rest_framework_3/horizontal/list_fieldset.html diff --git a/rest_framework/templates/rest_framework/horizontal/radio.html b/rest_framework_3/templates/rest_framework_3/horizontal/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/radio.html rename to rest_framework_3/templates/rest_framework_3/horizontal/radio.html diff --git a/rest_framework/templates/rest_framework/horizontal/select.html b/rest_framework_3/templates/rest_framework_3/horizontal/select.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/select.html rename to rest_framework_3/templates/rest_framework_3/horizontal/select.html diff --git a/rest_framework/templates/rest_framework/horizontal/select_multiple.html b/rest_framework_3/templates/rest_framework_3/horizontal/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/select_multiple.html rename to rest_framework_3/templates/rest_framework_3/horizontal/select_multiple.html diff --git a/rest_framework/templates/rest_framework/horizontal/textarea.html b/rest_framework_3/templates/rest_framework_3/horizontal/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/textarea.html rename to rest_framework_3/templates/rest_framework_3/horizontal/textarea.html diff --git a/rest_framework/templates/rest_framework/inline/checkbox.html b/rest_framework_3/templates/rest_framework_3/inline/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/checkbox.html rename to rest_framework_3/templates/rest_framework_3/inline/checkbox.html diff --git a/rest_framework/templates/rest_framework/inline/checkbox_multiple.html b/rest_framework_3/templates/rest_framework_3/inline/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/checkbox_multiple.html rename to rest_framework_3/templates/rest_framework_3/inline/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/inline/fieldset.html b/rest_framework_3/templates/rest_framework_3/inline/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fieldset.html rename to rest_framework_3/templates/rest_framework_3/inline/fieldset.html diff --git a/rest_framework/templates/rest_framework/inline/form.html b/rest_framework_3/templates/rest_framework_3/inline/form.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/form.html rename to rest_framework_3/templates/rest_framework_3/inline/form.html diff --git a/rest_framework/templates/rest_framework/inline/input.html b/rest_framework_3/templates/rest_framework_3/inline/input.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/input.html rename to rest_framework_3/templates/rest_framework_3/inline/input.html diff --git a/rest_framework/templates/rest_framework/inline/list_fieldset.html b/rest_framework_3/templates/rest_framework_3/inline/list_fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/list_fieldset.html rename to rest_framework_3/templates/rest_framework_3/inline/list_fieldset.html diff --git a/rest_framework/templates/rest_framework/inline/radio.html b/rest_framework_3/templates/rest_framework_3/inline/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/radio.html rename to rest_framework_3/templates/rest_framework_3/inline/radio.html diff --git a/rest_framework/templates/rest_framework/inline/select.html b/rest_framework_3/templates/rest_framework_3/inline/select.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/select.html rename to rest_framework_3/templates/rest_framework_3/inline/select.html diff --git a/rest_framework/templates/rest_framework/inline/select_multiple.html b/rest_framework_3/templates/rest_framework_3/inline/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/select_multiple.html rename to rest_framework_3/templates/rest_framework_3/inline/select_multiple.html diff --git a/rest_framework/templates/rest_framework/inline/textarea.html b/rest_framework_3/templates/rest_framework_3/inline/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/textarea.html rename to rest_framework_3/templates/rest_framework_3/inline/textarea.html diff --git a/rest_framework/templates/rest_framework/login.html b/rest_framework_3/templates/rest_framework_3/login.html similarity index 100% rename from rest_framework/templates/rest_framework/login.html rename to rest_framework_3/templates/rest_framework_3/login.html diff --git a/rest_framework/templates/rest_framework/login_base.html b/rest_framework_3/templates/rest_framework_3/login_base.html similarity index 100% rename from rest_framework/templates/rest_framework/login_base.html rename to rest_framework_3/templates/rest_framework_3/login_base.html diff --git a/rest_framework/templates/rest_framework/pagination/numbers.html b/rest_framework_3/templates/rest_framework_3/pagination/numbers.html similarity index 100% rename from rest_framework/templates/rest_framework/pagination/numbers.html rename to rest_framework_3/templates/rest_framework_3/pagination/numbers.html diff --git a/rest_framework/templates/rest_framework/pagination/previous_and_next.html b/rest_framework_3/templates/rest_framework_3/pagination/previous_and_next.html similarity index 100% rename from rest_framework/templates/rest_framework/pagination/previous_and_next.html rename to rest_framework_3/templates/rest_framework_3/pagination/previous_and_next.html diff --git a/rest_framework/templates/rest_framework/raw_data_form.html b/rest_framework_3/templates/rest_framework_3/raw_data_form.html similarity index 100% rename from rest_framework/templates/rest_framework/raw_data_form.html rename to rest_framework_3/templates/rest_framework_3/raw_data_form.html diff --git a/rest_framework/templates/rest_framework/vertical/checkbox.html b/rest_framework_3/templates/rest_framework_3/vertical/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/checkbox.html rename to rest_framework_3/templates/rest_framework_3/vertical/checkbox.html diff --git a/rest_framework/templates/rest_framework/vertical/checkbox_multiple.html b/rest_framework_3/templates/rest_framework_3/vertical/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/checkbox_multiple.html rename to rest_framework_3/templates/rest_framework_3/vertical/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/vertical/fieldset.html b/rest_framework_3/templates/rest_framework_3/vertical/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fieldset.html rename to rest_framework_3/templates/rest_framework_3/vertical/fieldset.html diff --git a/rest_framework/templates/rest_framework/vertical/form.html b/rest_framework_3/templates/rest_framework_3/vertical/form.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/form.html rename to rest_framework_3/templates/rest_framework_3/vertical/form.html diff --git a/rest_framework/templates/rest_framework/vertical/input.html b/rest_framework_3/templates/rest_framework_3/vertical/input.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/input.html rename to rest_framework_3/templates/rest_framework_3/vertical/input.html diff --git a/rest_framework/templates/rest_framework/vertical/list_fieldset.html b/rest_framework_3/templates/rest_framework_3/vertical/list_fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/list_fieldset.html rename to rest_framework_3/templates/rest_framework_3/vertical/list_fieldset.html diff --git a/rest_framework/templates/rest_framework/vertical/radio.html b/rest_framework_3/templates/rest_framework_3/vertical/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/radio.html rename to rest_framework_3/templates/rest_framework_3/vertical/radio.html diff --git a/rest_framework/templates/rest_framework/vertical/select.html b/rest_framework_3/templates/rest_framework_3/vertical/select.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/select.html rename to rest_framework_3/templates/rest_framework_3/vertical/select.html diff --git a/rest_framework/templates/rest_framework/vertical/select_multiple.html b/rest_framework_3/templates/rest_framework_3/vertical/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/select_multiple.html rename to rest_framework_3/templates/rest_framework_3/vertical/select_multiple.html diff --git a/rest_framework/templates/rest_framework/vertical/textarea.html b/rest_framework_3/templates/rest_framework_3/vertical/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/textarea.html rename to rest_framework_3/templates/rest_framework_3/vertical/textarea.html diff --git a/rest_framework/templatetags/__init__.py b/rest_framework_3/templatetags/__init__.py similarity index 100% rename from rest_framework/templatetags/__init__.py rename to rest_framework_3/templatetags/__init__.py diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework_3/templatetags/rest_framework_3.py similarity index 98% rename from rest_framework/templatetags/rest_framework.py rename to rest_framework_3/templatetags/rest_framework_3.py index bf0dc7b8f..5c31da0b7 100644 --- a/rest_framework/templatetags/rest_framework.py +++ b/rest_framework_3/templatetags/rest_framework_3.py @@ -6,8 +6,8 @@ from django.utils.encoding import iri_to_uri, force_text from django.utils.html import escape from django.utils.safestring import SafeData, mark_safe from django.utils.html import smart_urlquote -from rest_framework.renderers import HTMLFormRenderer -from rest_framework.utils.urls import replace_query_param +from rest_framework_3.renderers import HTMLFormRenderer +from rest_framework_3.utils.urls import replace_query_param import re register = template.Library() diff --git a/rest_framework/test.py b/rest_framework_3/test.py similarity index 97% rename from rest_framework/test.py rename to rest_framework_3/test.py index a83d082ab..52878b695 100644 --- a/rest_framework/test.py +++ b/rest_framework_3/test.py @@ -10,9 +10,9 @@ 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 +from rest_framework_3.settings import api_settings +from rest_framework_3.compat import RequestFactory as DjangoRequestFactory +from rest_framework_3.compat import force_bytes_or_smart_bytes def force_authenticate(request, user=None, token=None): diff --git a/rest_framework/throttling.py b/rest_framework_3/throttling.py similarity index 99% rename from rest_framework/throttling.py rename to rest_framework_3/throttling.py index 261fc2463..9210cf2c2 100644 --- a/rest_framework/throttling.py +++ b/rest_framework_3/throttling.py @@ -4,7 +4,7 @@ Provides various throttling policies. from __future__ import unicode_literals from django.core.cache import cache as default_cache from django.core.exceptions import ImproperlyConfigured -from rest_framework.settings import api_settings +from rest_framework_3.settings import api_settings import time diff --git a/rest_framework/urlpatterns.py b/rest_framework_3/urlpatterns.py similarity index 97% rename from rest_framework/urlpatterns.py rename to rest_framework_3/urlpatterns.py index 038e9ee38..24d49e511 100644 --- a/rest_framework/urlpatterns.py +++ b/rest_framework_3/urlpatterns.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from django.conf.urls import url, include from django.core.urlresolvers import RegexURLResolver -from rest_framework.settings import api_settings +from rest_framework_3.settings import api_settings def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required): diff --git a/rest_framework/urls.py b/rest_framework_3/urls.py similarity index 79% rename from rest_framework/urls.py rename to rest_framework_3/urls.py index cfcee534b..1427f53fe 100644 --- a/rest_framework/urls.py +++ b/rest_framework_3/urls.py @@ -6,10 +6,10 @@ your API requires authentication: urlpatterns = patterns('', ... - url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')) + url(r'^auth/', include('rest_framework_3.urls', namespace='rest_framework_3')) ) -The urls must be namespaced as 'rest_framework', and you should make sure +The urls must be namespaced as 'rest_framework_3', and you should make sure your authentication settings include `SessionAuthentication`. """ from __future__ import unicode_literals diff --git a/rest_framework/utils/__init__.py b/rest_framework_3/utils/__init__.py similarity index 100% rename from rest_framework/utils/__init__.py rename to rest_framework_3/utils/__init__.py diff --git a/rest_framework/utils/breadcrumbs.py b/rest_framework_3/utils/breadcrumbs.py similarity index 94% rename from rest_framework/utils/breadcrumbs.py rename to rest_framework_3/utils/breadcrumbs.py index e6690d170..812337492 100644 --- a/rest_framework/utils/breadcrumbs.py +++ b/rest_framework_3/utils/breadcrumbs.py @@ -8,8 +8,8 @@ def get_breadcrumbs(url): tuple of (name, url). """ - from rest_framework.settings import api_settings - from rest_framework.views import APIView + from rest_framework_3.settings import api_settings + from rest_framework_3.views import APIView view_name_func = api_settings.VIEW_NAME_FUNCTION diff --git a/rest_framework/utils/encoders.py b/rest_framework_3/utils/encoders.py similarity index 97% rename from rest_framework/utils/encoders.py rename to rest_framework_3/utils/encoders.py index 2160d18b6..f557dd588 100644 --- a/rest_framework/utils/encoders.py +++ b/rest_framework_3/utils/encoders.py @@ -6,7 +6,7 @@ from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise -from rest_framework.compat import total_seconds +from rest_framework_3.compat import total_seconds import datetime import decimal import json diff --git a/rest_framework/utils/field_mapping.py b/rest_framework_3/utils/field_mapping.py similarity index 98% rename from rest_framework/utils/field_mapping.py rename to rest_framework_3/utils/field_mapping.py index c97ec5d0e..7971cb8cb 100644 --- a/rest_framework/utils/field_mapping.py +++ b/rest_framework_3/utils/field_mapping.py @@ -5,8 +5,8 @@ keyword arguments that should be used for their equivelent serializer fields. from django.core import validators from django.db import models from django.utils.text import capfirst -from rest_framework.compat import clean_manytomany_helptext -from rest_framework.validators import UniqueValidator +from rest_framework_3.compat import clean_manytomany_helptext +from rest_framework_3.validators import UniqueValidator import inspect diff --git a/rest_framework/utils/formatting.py b/rest_framework_3/utils/formatting.py similarity index 96% rename from rest_framework/utils/formatting.py rename to rest_framework_3/utils/formatting.py index 8b6f005e1..67d2e6865 100644 --- a/rest_framework/utils/formatting.py +++ b/rest_framework_3/utils/formatting.py @@ -4,7 +4,7 @@ Utility functions to return a formatted name and description for a given view. from __future__ import unicode_literals from django.utils.html import escape from django.utils.safestring import mark_safe -from rest_framework.compat import apply_markdown, force_text +from rest_framework_3.compat import apply_markdown, force_text import re diff --git a/rest_framework/utils/html.py b/rest_framework_3/utils/html.py similarity index 100% rename from rest_framework/utils/html.py rename to rest_framework_3/utils/html.py diff --git a/rest_framework/utils/humanize_datetime.py b/rest_framework_3/utils/humanize_datetime.py similarity index 97% rename from rest_framework/utils/humanize_datetime.py rename to rest_framework_3/utils/humanize_datetime.py index 649f2abc6..c9974310d 100644 --- a/rest_framework/utils/humanize_datetime.py +++ b/rest_framework_3/utils/humanize_datetime.py @@ -1,7 +1,7 @@ """ Helper functions that convert strftime formats into more readable representations. """ -from rest_framework import ISO_8601 +from rest_framework_3 import ISO_8601 def datetime_formats(formats): diff --git a/rest_framework/utils/mediatypes.py b/rest_framework_3/utils/mediatypes.py similarity index 98% rename from rest_framework/utils/mediatypes.py rename to rest_framework_3/utils/mediatypes.py index de2931c28..889ac23a2 100644 --- a/rest_framework/utils/mediatypes.py +++ b/rest_framework_3/utils/mediatypes.py @@ -6,7 +6,7 @@ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 from __future__ import unicode_literals from django.http.multipartparser import parse_header from django.utils.encoding import python_2_unicode_compatible -from rest_framework import HTTP_HEADER_ENCODING +from rest_framework_3 import HTTP_HEADER_ENCODING def media_type_matches(lhs, rhs): diff --git a/rest_framework/utils/model_meta.py b/rest_framework_3/utils/model_meta.py similarity index 99% rename from rest_framework/utils/model_meta.py rename to rest_framework_3/utils/model_meta.py index 19f751b04..fe48ae560 100644 --- a/rest_framework/utils/model_meta.py +++ b/rest_framework_3/utils/model_meta.py @@ -9,7 +9,7 @@ from collections import namedtuple from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils import six -from rest_framework.compat import OrderedDict +from rest_framework_3.compat import OrderedDict import inspect diff --git a/rest_framework/utils/representation.py b/rest_framework_3/utils/representation.py similarity index 98% rename from rest_framework/utils/representation.py rename to rest_framework_3/utils/representation.py index 1bfc64c1f..29008bd44 100644 --- a/rest_framework/utils/representation.py +++ b/rest_framework_3/utils/representation.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals from django.db import models from django.utils.encoding import force_text from django.utils.functional import Promise -from rest_framework.compat import unicode_repr +from rest_framework_3.compat import unicode_repr import re diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework_3/utils/serializer_helpers.py similarity index 98% rename from rest_framework/utils/serializer_helpers.py rename to rest_framework_3/utils/serializer_helpers.py index 87bb3ac08..27b591c14 100644 --- a/rest_framework/utils/serializer_helpers.py +++ b/rest_framework_3/utils/serializer_helpers.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals import collections -from rest_framework.compat import OrderedDict, unicode_to_repr +from rest_framework_3.compat import OrderedDict, unicode_to_repr class ReturnDict(OrderedDict): diff --git a/rest_framework/utils/urls.py b/rest_framework_3/utils/urls.py similarity index 100% rename from rest_framework/utils/urls.py rename to rest_framework_3/utils/urls.py diff --git a/rest_framework/validators.py b/rest_framework_3/validators.py similarity index 98% rename from rest_framework/validators.py rename to rest_framework_3/validators.py index 6ae80b897..d6c7777b0 100644 --- a/rest_framework/validators.py +++ b/rest_framework_3/validators.py @@ -8,9 +8,9 @@ object creation, and makes it possible to switch between using the implicit """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ -from rest_framework.compat import unicode_to_repr -from rest_framework.exceptions import ValidationError -from rest_framework.utils.representation import smart_repr +from rest_framework_3.compat import unicode_to_repr +from rest_framework_3.exceptions import ValidationError +from rest_framework_3.utils.representation import smart_repr class UniqueValidator(object): diff --git a/rest_framework/versioning.py b/rest_framework_3/versioning.py similarity index 95% rename from rest_framework/versioning.py rename to rest_framework_3/versioning.py index 51b886f38..aa1ceee5e 100644 --- a/rest_framework/versioning.py +++ b/rest_framework_3/versioning.py @@ -1,12 +1,12 @@ # coding: utf-8 from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ -from rest_framework import exceptions -from rest_framework.compat import unicode_http_header -from rest_framework.reverse import _reverse -from rest_framework.settings import api_settings -from rest_framework.templatetags.rest_framework import replace_query_param -from rest_framework.utils.mediatypes import _MediaType +from rest_framework_3 import exceptions +from rest_framework_3.compat import unicode_http_header +from rest_framework_3.reverse import _reverse +from rest_framework_3.settings import api_settings +from rest_framework_3.templatetags.rest_framework import replace_query_param +from rest_framework_3.utils.mediatypes import _MediaType import re diff --git a/rest_framework/views.py b/rest_framework_3/views.py similarity index 98% rename from rest_framework/views.py rename to rest_framework_3/views.py index f0aadc0e5..53e613541 100644 --- a/rest_framework/views.py +++ b/rest_framework_3/views.py @@ -8,12 +8,12 @@ from django.utils import six from django.utils.encoding import smart_text from django.utils.translation import ugettext_lazy as _ from django.views.decorators.csrf import csrf_exempt -from rest_framework import status, exceptions -from rest_framework.compat import HttpResponseBase, View -from rest_framework.request import Request -from rest_framework.response import Response -from rest_framework.settings import api_settings -from rest_framework.utils import formatting +from rest_framework_3 import status, exceptions +from rest_framework_3.compat import HttpResponseBase, View +from rest_framework_3.request import Request +from rest_framework_3.response import Response +from rest_framework_3.settings import api_settings +from rest_framework_3.utils import formatting import inspect import warnings diff --git a/rest_framework/viewsets.py b/rest_framework_3/viewsets.py similarity index 99% rename from rest_framework/viewsets.py rename to rest_framework_3/viewsets.py index 88c763da4..896bdbe58 100644 --- a/rest_framework/viewsets.py +++ b/rest_framework_3/viewsets.py @@ -21,7 +21,7 @@ from __future__ import unicode_literals from functools import update_wrapper from django.utils.decorators import classonlymethod from django.views.decorators.csrf import csrf_exempt -from rest_framework import views, generics, mixins +from rest_framework_3 import views, generics, mixins class ViewSetMixin(object): diff --git a/runtests.py b/runtests.py index 0008bfae5..709f8f24b 100755 --- a/runtests.py +++ b/runtests.py @@ -12,7 +12,7 @@ PYTEST_ARGS = { 'fast': ['tests', '--tb=short', '-q'], } -FLAKE8_ARGS = ['rest_framework', 'tests', '--ignore=E501'] +FLAKE8_ARGS = ['rest_framework_3', 'tests', '--ignore=E501'] sys.path.append(os.path.dirname(__file__)) diff --git a/setup.py b/setup.py index 4cdcfa86e..10445085b 100755 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def get_package_data(package): return {package: filepaths} -version = get_version('rest_framework') +version = get_version('rest_framework_3') if sys.argv[-1] == 'publish': @@ -60,15 +60,15 @@ if sys.argv[-1] == 'publish': setup( - name='djangorestframework', + name='djangorestframework-3', version=version, url='http://www.django-rest-framework.org', license='BSD', description='Web APIs for Django, made easy.', author='Tom Christie', author_email='tom@tomchristie.com', # SEE NOTE BELOW (*) - packages=get_packages('rest_framework'), - package_data=get_package_data('rest_framework'), + packages=get_packages('rest_framework_3'), + package_data=get_package_data('rest_framework_3'), install_requires=[], zip_safe=False, classifiers=[ diff --git a/tests/browsable_api/auth_urls.py b/tests/browsable_api/auth_urls.py index 97bc10360..23dbc1924 100644 --- a/tests/browsable_api/auth_urls.py +++ b/tests/browsable_api/auth_urls.py @@ -7,5 +7,5 @@ from .views import MockView urlpatterns = patterns( '', (r'^$', MockView.as_view()), - url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), + url(r'^auth/', include('rest_framework_3.urls', namespace='rest_framework_3')), ) diff --git a/tests/browsable_api/test_browsable_api.py b/tests/browsable_api/test_browsable_api.py index 5f2647838..c54713643 100644 --- a/tests/browsable_api/test_browsable_api.py +++ b/tests/browsable_api/test_browsable_api.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.contrib.auth.models import User from django.test import TestCase -from rest_framework.test import APIClient +from rest_framework_3.test import APIClient class DropdownWithAuthTests(TestCase): diff --git a/tests/browsable_api/views.py b/tests/browsable_api/views.py index 000f4e804..6ff2f9c42 100644 --- a/tests/browsable_api/views.py +++ b/tests/browsable_api/views.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from rest_framework.views import APIView -from rest_framework import authentication -from rest_framework import renderers -from rest_framework.response import Response +from rest_framework_3.views import APIView +from rest_framework_3 import authentication +from rest_framework_3 import renderers +from rest_framework_3.response import Response class MockView(APIView): diff --git a/tests/conftest.py b/tests/conftest.py index 03b4e3285..1987cfe60 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,8 +28,8 @@ def pytest_configure(): 'django.contrib.sites', 'django.contrib.staticfiles', - 'rest_framework', - 'rest_framework.authtoken', + 'rest_framework_3', + 'rest_framework_3.authtoken', 'tests', ), PASSWORD_HASHERS=( diff --git a/tests/description.py b/tests/description.py index b46d7f54d..ab66a986e 100644 --- a/tests/description.py +++ b/tests/description.py @@ -6,7 +6,7 @@ # to catch unicode related errors, a mock view has to be declared in a separate # module. -from rest_framework.views import APIView +from rest_framework_3.views import APIView # test strings snatched from http://www.columbia.edu/~fdc/utf8/, diff --git a/tests/test_authentication.py b/tests/test_authentication.py index 91e49f9d8..f846a3d97 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -4,21 +4,21 @@ from django.contrib.auth.models import User from django.http import HttpResponse from django.test import TestCase from django.utils import six -from rest_framework import HTTP_HEADER_ENCODING -from rest_framework import exceptions -from rest_framework import permissions -from rest_framework import renderers -from rest_framework.response import Response -from rest_framework import status -from rest_framework.authentication import ( +from rest_framework_3 import HTTP_HEADER_ENCODING +from rest_framework_3 import exceptions +from rest_framework_3 import permissions +from rest_framework_3 import renderers +from rest_framework_3.response import Response +from rest_framework_3 import status +from rest_framework_3.authentication import ( BaseAuthentication, TokenAuthentication, BasicAuthentication, SessionAuthentication, ) -from rest_framework.authtoken.models import Token -from rest_framework.test import APIRequestFactory, APIClient -from rest_framework.views import APIView +from rest_framework_3.authtoken.models import Token +from rest_framework_3.test import APIRequestFactory, APIClient +from rest_framework_3.views import APIView import base64 factory = APIRequestFactory() @@ -42,8 +42,8 @@ urlpatterns = patterns( (r'^session/$', MockView.as_view(authentication_classes=[SessionAuthentication])), (r'^basic/$', MockView.as_view(authentication_classes=[BasicAuthentication])), (r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])), - (r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'), - url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')) + (r'^auth-token/$', 'rest_framework_3.authtoken.views.obtain_auth_token'), + url(r'^auth/', include('rest_framework_3.urls', namespace='rest_framework_3')) ) diff --git a/tests/test_bound_fields.py b/tests/test_bound_fields.py index bfc54b233..7c74e46f5 100644 --- a/tests/test_bound_fields.py +++ b/tests/test_bound_fields.py @@ -1,4 +1,4 @@ -from rest_framework import serializers +from rest_framework_3 import serializers class TestSimpleBoundField: diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 195f0ba3e..b5b66033a 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -1,15 +1,15 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework import status -from rest_framework.authentication import BasicAuthentication -from rest_framework.parsers import JSONParser -from rest_framework.permissions import IsAuthenticated -from rest_framework.response import Response -from rest_framework.renderers import JSONRenderer -from rest_framework.test import APIRequestFactory -from rest_framework.throttling import UserRateThrottle -from rest_framework.views import APIView -from rest_framework.decorators import ( +from rest_framework_3 import status +from rest_framework_3.authentication import BasicAuthentication +from rest_framework_3.parsers import JSONParser +from rest_framework_3.permissions import IsAuthenticated +from rest_framework_3.response import Response +from rest_framework_3.renderers import JSONRenderer +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.throttling import UserRateThrottle +from rest_framework_3.views import APIView +from rest_framework_3.decorators import ( api_view, renderer_classes, parser_classes, diff --git a/tests/test_description.py b/tests/test_description.py index 78ce2350b..8832ae030 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals from django.test import TestCase from django.utils.encoding import python_2_unicode_compatible, smart_text -from rest_framework.compat import apply_markdown -from rest_framework.views import APIView +from rest_framework_3.compat import apply_markdown +from rest_framework_3.views import APIView from .description import ViewWithNonASCIICharactersInDocstring from .description import UTF8_TEST_DOCSTRING diff --git a/tests/test_fields.py b/tests/test_fields.py index da6bd6ceb..4d7495fea 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1,6 +1,6 @@ from decimal import Decimal from django.utils import timezone -from rest_framework import serializers +from rest_framework_3 import serializers import datetime import django import pytest diff --git a/tests/test_filters.py b/tests/test_filters.py index e7cb0c795..2f699b18c 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -9,9 +9,9 @@ from django.test.utils import override_settings from django.utils import unittest from django.utils.dateparse import parse_date from django.utils.six.moves import reload_module -from rest_framework import generics, serializers, status, filters -from rest_framework.compat import django_filters -from rest_framework.test import APIRequestFactory +from rest_framework_3 import generics, serializers, status, filters +from rest_framework_3.compat import django_filters +from rest_framework_3.test import APIRequestFactory from .models import BaseFilterableItem, FilterableItem, BasicModel diff --git a/tests/test_generics.py b/tests/test_generics.py index 88e792cea..845638f14 100644 --- a/tests/test_generics.py +++ b/tests/test_generics.py @@ -4,8 +4,8 @@ from django.db import models from django.shortcuts import get_object_or_404 from django.test import TestCase from django.utils import six -from rest_framework import generics, renderers, serializers, status -from rest_framework.test import APIRequestFactory +from rest_framework_3 import generics, renderers, serializers, status +from rest_framework_3.test import APIRequestFactory from tests.models import BasicModel, RESTFrameworkModel from tests.models import ForeignKeySource, ForeignKeyTarget diff --git a/tests/test_htmlrenderer.py b/tests/test_htmlrenderer.py index a33b832f5..2aa2dc23c 100644 --- a/tests/test_htmlrenderer.py +++ b/tests/test_htmlrenderer.py @@ -5,10 +5,10 @@ from django.http import Http404 from django.test import TestCase from django.template import TemplateDoesNotExist, Template from django.utils import six -from rest_framework import status -from rest_framework.decorators import api_view, renderer_classes -from rest_framework.renderers import TemplateHTMLRenderer -from rest_framework.response import Response +from rest_framework_3 import status +from rest_framework_3.decorators import api_view, renderer_classes +from rest_framework_3.renderers import TemplateHTMLRenderer +from rest_framework_3.response import Response import django.template.loader diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 731aedba3..a0204e52c 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals -from rest_framework import exceptions, metadata, serializers, status, views, versioning -from rest_framework.request import Request -from rest_framework.renderers import BrowsableAPIRenderer -from rest_framework.test import APIRequestFactory +from rest_framework_3 import exceptions, metadata, serializers, status, views, versioning +from rest_framework_3.request import Request +from rest_framework_3.renderers import BrowsableAPIRenderer +from rest_framework_3.test import APIRequestFactory request = Request(APIRequestFactory().options('/')) diff --git a/tests/test_middleware.py b/tests/test_middleware.py index 4c099fca1..3c9e52b14 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -1,10 +1,10 @@ from django.conf.urls import patterns, url from django.contrib.auth.models import User -from rest_framework.authentication import TokenAuthentication -from rest_framework.authtoken.models import Token -from rest_framework.test import APITestCase -from rest_framework.views import APIView +from rest_framework_3.authentication import TokenAuthentication +from rest_framework_3.authtoken.models import Token +from rest_framework_3.test import APITestCase +from rest_framework_3.views import APIView urlpatterns = patterns( diff --git a/tests/test_model_serializer.py b/tests/test_model_serializer.py index dc34649ea..1cde95225 100644 --- a/tests/test_model_serializer.py +++ b/tests/test_model_serializer.py @@ -11,8 +11,8 @@ from django.core.validators import MaxValueValidator, MinValueValidator, MinLeng from django.db import models from django.test import TestCase from django.utils import six -from rest_framework import serializers -from rest_framework.compat import unicode_repr +from rest_framework_3 import serializers +from rest_framework_3.compat import unicode_repr def dedent(blocktext): diff --git a/tests/test_multitable_inheritance.py b/tests/test_multitable_inheritance.py index 15627e1dd..00e44444c 100644 --- a/tests/test_multitable_inheritance.py +++ b/tests/test_multitable_inheritance.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from django.db import models from django.test import TestCase -from rest_framework import serializers +from rest_framework_3 import serializers from tests.models import RESTFrameworkModel diff --git a/tests/test_negotiation.py b/tests/test_negotiation.py index 04b89eb60..02c673b06 100644 --- a/tests/test_negotiation.py +++ b/tests/test_negotiation.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework.negotiation import DefaultContentNegotiation -from rest_framework.request import Request -from rest_framework.renderers import BaseRenderer -from rest_framework.test import APIRequestFactory +from rest_framework_3.negotiation import DefaultContentNegotiation +from rest_framework_3.request import Request +from rest_framework_3.renderers import BaseRenderer +from rest_framework_3.test import APIRequestFactory factory = APIRequestFactory() diff --git a/tests/test_pagination.py b/tests/test_pagination.py index 6b39a6f22..d5a1ccda6 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -1,9 +1,9 @@ # coding: utf-8 from __future__ import unicode_literals -from rest_framework import exceptions, generics, pagination, serializers, status, filters -from rest_framework.request import Request -from rest_framework.pagination import PageLink, PAGE_BREAK -from rest_framework.test import APIRequestFactory +from rest_framework_3 import exceptions, generics, pagination, serializers, status, filters +from rest_framework_3.request import Request +from rest_framework_3.pagination import PageLink, PAGE_BREAK +from rest_framework_3.test import APIRequestFactory import pytest factory = APIRequestFactory() diff --git a/tests/test_parsers.py b/tests/test_parsers.py index fe6aec196..25ff06f36 100644 --- a/tests/test_parsers.py +++ b/tests/test_parsers.py @@ -5,8 +5,8 @@ from django import forms from django.core.files.uploadhandler import MemoryFileUploadHandler from django.test import TestCase from django.utils.six.moves import StringIO -from rest_framework.exceptions import ParseError -from rest_framework.parsers import FormParser, FileUploadParser +from rest_framework_3.exceptions import ParseError +from rest_framework_3.parsers import FormParser, FileUploadParser class Form(forms.Form): diff --git a/tests/test_permissions.py b/tests/test_permissions.py index 9225308c7..cd5c9cc04 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -3,10 +3,10 @@ from django.contrib.auth.models import User, Permission, Group from django.db import models from django.test import TestCase from django.utils import unittest -from rest_framework import generics, serializers, status, permissions, authentication, HTTP_HEADER_ENCODING -from rest_framework.compat import guardian, get_model_name -from rest_framework.filters import DjangoObjectPermissionsFilter -from rest_framework.test import APIRequestFactory +from rest_framework_3 import generics, serializers, status, permissions, authentication, HTTP_HEADER_ENCODING +from rest_framework_3.compat import guardian, get_model_name +from rest_framework_3.filters import DjangoObjectPermissionsFilter +from rest_framework_3.test import APIRequestFactory from tests.models import BasicModel import base64 diff --git a/tests/test_relations.py b/tests/test_relations.py index fbe176e24..8cf2cda29 100644 --- a/tests/test_relations.py +++ b/tests/test_relations.py @@ -1,9 +1,9 @@ from .utils import mock_reverse, fail_reverse, BadType, MockObject, MockQueryset from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import MultiValueDict -from rest_framework import serializers -from rest_framework.fields import empty -from rest_framework.test import APISimpleTestCase +from rest_framework_3 import serializers +from rest_framework_3.fields import empty +from rest_framework_3.test import APISimpleTestCase import pytest diff --git a/tests/test_relations_generic.py b/tests/test_relations_generic.py index b600b3333..8239bdd2c 100644 --- a/tests/test_relations_generic.py +++ b/tests/test_relations_generic.py @@ -4,7 +4,7 @@ from django.contrib.contenttypes.generic import GenericRelation, GenericForeignK from django.db import models from django.test import TestCase from django.utils.encoding import python_2_unicode_compatible -from rest_framework import serializers +from rest_framework_3 import serializers @python_2_unicode_compatible diff --git a/tests/test_relations_hyperlink.py b/tests/test_relations_hyperlink.py index 33b09713a..7fed721d1 100644 --- a/tests/test_relations_hyperlink.py +++ b/tests/test_relations_hyperlink.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals from django.conf.urls import url from django.test import TestCase -from rest_framework import serializers -from rest_framework.test import APIRequestFactory +from rest_framework_3 import serializers +from rest_framework_3.test import APIRequestFactory from tests.models import ( ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, NullableOneToOneSource diff --git a/tests/test_relations_pk.py b/tests/test_relations_pk.py index ca43272b0..9f97e302e 100644 --- a/tests/test_relations_pk.py +++ b/tests/test_relations_pk.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from django.test import TestCase from django.utils import six -from rest_framework import serializers +from rest_framework_3 import serializers from tests.models import ( ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, NullableOneToOneSource, diff --git a/tests/test_relations_slug.py b/tests/test_relations_slug.py index cd2cb1ed6..959f917b6 100644 --- a/tests/test_relations_slug.py +++ b/tests/test_relations_slug.py @@ -1,5 +1,5 @@ from django.test import TestCase -from rest_framework import serializers +from rest_framework_3 import serializers from tests.models import NullableForeignKeySource, ForeignKeySource, ForeignKeyTarget diff --git a/tests/test_renderers.py b/tests/test_renderers.py index cb76f6830..69b6017e5 100644 --- a/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -6,16 +6,16 @@ from django.db import models from django.test import TestCase from django.utils import six from django.utils.translation import ugettext_lazy as _ -from rest_framework import status, permissions -from rest_framework.compat import OrderedDict -from rest_framework.response import Response -from rest_framework.views import APIView -from rest_framework import serializers -from rest_framework.renderers import ( +from rest_framework_3 import status, permissions +from rest_framework_3.compat import OrderedDict +from rest_framework_3.response import Response +from rest_framework_3.views import APIView +from rest_framework_3 import serializers +from rest_framework_3.renderers import ( BaseRenderer, JSONRenderer, BrowsableAPIRenderer, HTMLFormRenderer ) -from rest_framework.settings import api_settings -from rest_framework.test import APIRequestFactory +from rest_framework_3.settings import api_settings +from rest_framework_3.test import APIRequestFactory from collections import MutableMapping import json import re @@ -112,7 +112,7 @@ urlpatterns = patterns( url(r'^html$', HTMLView.as_view()), url(r'^html1$', HTMLView1.as_view()), url(r'^empty$', EmptyGETView.as_view()), - url(r'^api', include('rest_framework.urls', namespace='rest_framework')) + url(r'^api', include('rest_framework_3.urls', namespace='rest_framework_3')) ) diff --git a/tests/test_request.py b/tests/test_request.py index c274ab69d..9111e8081 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -9,19 +9,19 @@ from django.contrib.sessions.middleware import SessionMiddleware from django.core.handlers.wsgi import WSGIRequest from django.test import TestCase from django.utils import six -from rest_framework import status -from rest_framework.authentication import SessionAuthentication -from rest_framework.parsers import ( +from rest_framework_3 import status +from rest_framework_3.authentication import SessionAuthentication +from rest_framework_3.parsers import ( BaseParser, FormParser, MultiPartParser, JSONParser ) -from rest_framework.request import Request, Empty -from rest_framework.response import Response -from rest_framework.settings import api_settings -from rest_framework.test import APIRequestFactory, APIClient -from rest_framework.views import APIView +from rest_framework_3.request import Request, Empty +from rest_framework_3.response import Response +from rest_framework_3.settings import api_settings +from rest_framework_3.test import APIRequestFactory, APIClient +from rest_framework_3.views import APIView from io import BytesIO import json @@ -257,7 +257,7 @@ class TestUserSetter(TestCase): class AuthRaisesAttributeError(object): def authenticate(self, request): import rest_framework - rest_framework.MISSPELLED_NAME_THAT_DOESNT_EXIST + rest_framework_3.MISSPELLED_NAME_THAT_DOESNT_EXIST self.request = Request(factory.get('/'), authenticators=(AuthRaisesAttributeError(),)) SessionMiddleware().process_request(self.request) diff --git a/tests/test_response.py b/tests/test_response.py index 4a9deaa29..84851c4e2 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -3,19 +3,19 @@ from django.conf.urls import patterns, url, include from django.test import TestCase from django.utils import six from tests.models import BasicModel -from rest_framework.response import Response -from rest_framework.views import APIView -from rest_framework import generics -from rest_framework import routers -from rest_framework import serializers -from rest_framework import status -from rest_framework.renderers import ( +from rest_framework_3.response import Response +from rest_framework_3.views import APIView +from rest_framework_3 import generics +from rest_framework_3 import routers +from rest_framework_3 import serializers +from rest_framework_3 import status +from rest_framework_3.renderers import ( BaseRenderer, JSONRenderer, BrowsableAPIRenderer ) -from rest_framework import viewsets -from rest_framework.settings import api_settings +from rest_framework_3 import viewsets +from rest_framework_3.settings import api_settings # Serializer used to test BasicModel @@ -122,7 +122,7 @@ urlpatterns = patterns( url(r'^html1$', HTMLView1.as_view()), url(r'^html_new_model$', HTMLNewModelView.as_view()), url(r'^html_new_model_viewset', include(new_model_viewset_router.urls)), - url(r'^restframework', include('rest_framework.urls', namespace='rest_framework')) + url(r'^restframework_3', include('rest_framework_3.urls', namespace='rest_framework_3')) ) diff --git a/tests/test_reverse.py b/tests/test_reverse.py index 08c270239..d7da279fa 100644 --- a/tests/test_reverse.py +++ b/tests/test_reverse.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.conf.urls import patterns, url from django.core.urlresolvers import NoReverseMatch from django.test import TestCase -from rest_framework.reverse import reverse -from rest_framework.test import APIRequestFactory +from rest_framework_3.reverse import reverse +from rest_framework_3.test import APIRequestFactory factory = APIRequestFactory() diff --git a/tests/test_routers.py b/tests/test_routers.py index 19eeb868d..988e45799 100644 --- a/tests/test_routers.py +++ b/tests/test_routers.py @@ -3,11 +3,11 @@ from django.conf.urls import url, include from django.db import models from django.test import TestCase from django.core.exceptions import ImproperlyConfigured -from rest_framework import serializers, viewsets, permissions -from rest_framework.decorators import detail_route, list_route -from rest_framework.response import Response -from rest_framework.routers import SimpleRouter, DefaultRouter -from rest_framework.test import APIRequestFactory +from rest_framework_3 import serializers, viewsets, permissions +from rest_framework_3.decorators import detail_route, list_route +from rest_framework_3.response import Response +from rest_framework_3.routers import SimpleRouter, DefaultRouter +from rest_framework_3.test import APIRequestFactory from collections import namedtuple factory = APIRequestFactory() diff --git a/tests/test_serializer.py b/tests/test_serializer.py index b7a0484bc..d2647cdaa 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -1,8 +1,8 @@ # coding: utf-8 from __future__ import unicode_literals from .utils import MockObject -from rest_framework import serializers -from rest_framework.compat import unicode_repr +from rest_framework_3 import serializers +from rest_framework_3.compat import unicode_repr import pickle import pytest diff --git a/tests/test_serializer_bulk_update.py b/tests/test_serializer_bulk_update.py index bc955b2ef..3faf64b91 100644 --- a/tests/test_serializer_bulk_update.py +++ b/tests/test_serializer_bulk_update.py @@ -4,7 +4,7 @@ Tests to cover bulk create and update using serializers. from __future__ import unicode_literals from django.test import TestCase from django.utils import six -from rest_framework import serializers +from rest_framework_3 import serializers class BulkCreateSerializerTests(TestCase): diff --git a/tests/test_serializer_lists.py b/tests/test_serializer_lists.py index 35b68ae7d..e94fda494 100644 --- a/tests/test_serializer_lists.py +++ b/tests/test_serializer_lists.py @@ -1,4 +1,4 @@ -from rest_framework import serializers +from rest_framework_3 import serializers from django.utils.datastructures import MultiValueDict diff --git a/tests/test_serializer_nested.py b/tests/test_serializer_nested.py index f5e4b26ad..ee4168d3b 100644 --- a/tests/test_serializer_nested.py +++ b/tests/test_serializer_nested.py @@ -1,4 +1,4 @@ -from rest_framework import serializers +from rest_framework_3 import serializers class TestNestedSerializer: diff --git a/tests/test_settings.py b/tests/test_settings.py index f2ff4ca14..5c9e4b53a 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework.settings import APISettings +from rest_framework_3.settings import APISettings class TestSettings(TestCase): diff --git a/tests/test_status.py b/tests/test_status.py index 721a6e30b..70a0ab7f1 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework.status import ( +from rest_framework_3.status import ( is_informational, is_success, is_redirect, is_client_error, is_server_error ) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 0cee91f19..bc0d8f0f0 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,8 +1,8 @@ # encoding: utf-8 from __future__ import unicode_literals from django.test import TestCase -from rest_framework.test import APIRequestFactory -from rest_framework.templatetags.rest_framework import add_query_param, urlize_quoted_links +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.templatetags.rest_framework import add_query_param, urlize_quoted_links factory = APIRequestFactory() diff --git a/tests/test_testing.py b/tests/test_testing.py index 87d2b61fa..6331286a2 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -4,9 +4,9 @@ from django.conf.urls import patterns, url from django.contrib.auth.models import User from django.shortcuts import redirect from django.test import TestCase -from rest_framework.decorators import api_view -from rest_framework.response import Response -from rest_framework.test import APIClient, APIRequestFactory, force_authenticate +from rest_framework_3.decorators import api_view +from rest_framework_3.response import Response +from rest_framework_3.test import APIClient, APIRequestFactory, force_authenticate from io import BytesIO diff --git a/tests/test_throttling.py b/tests/test_throttling.py index 50a53b3eb..cdcb87fd7 100644 --- a/tests/test_throttling.py +++ b/tests/test_throttling.py @@ -5,11 +5,11 @@ from __future__ import unicode_literals from django.test import TestCase from django.contrib.auth.models import User from django.core.cache import cache -from rest_framework.settings import api_settings -from rest_framework.test import APIRequestFactory -from rest_framework.views import APIView -from rest_framework.throttling import BaseThrottle, UserRateThrottle, ScopedRateThrottle -from rest_framework.response import Response +from rest_framework_3.settings import api_settings +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.views import APIView +from rest_framework_3.throttling import BaseThrottle, UserRateThrottle, ScopedRateThrottle +from rest_framework_3.response import Response class User3SecRateThrottle(UserRateThrottle): diff --git a/tests/test_urlpatterns.py b/tests/test_urlpatterns.py index e0060e690..cfd82f4b5 100644 --- a/tests/test_urlpatterns.py +++ b/tests/test_urlpatterns.py @@ -3,8 +3,8 @@ from collections import namedtuple from django.conf.urls import patterns, url, include from django.core import urlresolvers from django.test import TestCase -from rest_framework.test import APIRequestFactory -from rest_framework.urlpatterns import format_suffix_patterns +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.urlpatterns import format_suffix_patterns # A container class for test paths for the test case diff --git a/tests/test_utils.py b/tests/test_utils.py index 8c286ea42..471539f2d 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -3,12 +3,12 @@ from django.core.exceptions import ImproperlyConfigured from django.conf.urls import patterns, url from django.test import TestCase from django.utils import six -from rest_framework.utils.model_meta import _resolve_model -from rest_framework.utils.breadcrumbs import get_breadcrumbs -from rest_framework.views import APIView +from rest_framework_3.utils.model_meta import _resolve_model +from rest_framework_3.utils.breadcrumbs import get_breadcrumbs +from rest_framework_3.views import APIView from tests.models import BasicModel -import rest_framework.utils.model_meta +import rest_framework_3.utils.model_meta class Root(APIView): @@ -150,16 +150,16 @@ class ResolveModelWithPatchedDjangoTests(TestCase): def setUp(self): """Monkeypatch get_model.""" - self.get_model = rest_framework.utils.model_meta.models.get_model + self.get_model = rest_framework_3.utils.model_meta.models.get_model def get_model(app_label, model_name): return None - rest_framework.utils.model_meta.models.get_model = get_model + rest_framework_3.utils.model_meta.models.get_model = get_model def tearDown(self): """Revert monkeypatching.""" - rest_framework.utils.model_meta.models.get_model = self.get_model + rest_framework_3.utils.model_meta.models.get_model = self.get_model def test_blows_up_if_model_does_not_resolve(self): with self.assertRaises(ImproperlyConfigured): diff --git a/tests/test_validation.py b/tests/test_validation.py index 4234efd36..f899a7c02 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.core.validators import RegexValidator, MaxValueValidator from django.db import models from django.test import TestCase -from rest_framework import generics, serializers, status -from rest_framework.test import APIRequestFactory +from rest_framework_3 import generics, serializers, status +from rest_framework_3.test import APIRequestFactory import re factory = APIRequestFactory() diff --git a/tests/test_validators.py b/tests/test_validators.py index 127ec6f8b..ef12f803e 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -1,6 +1,6 @@ from django.db import models from django.test import TestCase -from rest_framework import serializers +from rest_framework_3 import serializers import datetime diff --git a/tests/test_versioning.py b/tests/test_versioning.py index 065385ad7..a32b8054d 100644 --- a/tests/test_versioning.py +++ b/tests/test_versioning.py @@ -1,13 +1,13 @@ from .utils import UsingURLPatterns from django.conf.urls import include, url -from rest_framework import serializers -from rest_framework import status, versioning -from rest_framework.decorators import APIView -from rest_framework.response import Response -from rest_framework.reverse import reverse -from rest_framework.test import APIRequestFactory, APITestCase -from rest_framework.versioning import NamespaceVersioning -from rest_framework.relations import PKOnlyObject +from rest_framework_3 import serializers +from rest_framework_3 import status, versioning +from rest_framework_3.decorators import APIView +from rest_framework_3.response import Response +from rest_framework_3.reverse import reverse +from rest_framework_3.test import APIRequestFactory, APITestCase +from rest_framework_3.versioning import NamespaceVersioning +from rest_framework_3.relations import PKOnlyObject import pytest diff --git a/tests/test_views.py b/tests/test_views.py index 77b113ee5..5e16f3b19 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -3,12 +3,12 @@ from __future__ import unicode_literals import sys import copy from django.test import TestCase -from rest_framework import status -from rest_framework.decorators import api_view -from rest_framework.response import Response -from rest_framework.settings import api_settings -from rest_framework.test import APIRequestFactory -from rest_framework.views import APIView +from rest_framework_3 import status +from rest_framework_3.decorators import api_view +from rest_framework_3.response import Response +from rest_framework_3.settings import api_settings +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.views import APIView factory = APIRequestFactory() diff --git a/tests/test_viewsets.py b/tests/test_viewsets.py index 4d18a955d..1092a4593 100644 --- a/tests/test_viewsets.py +++ b/tests/test_viewsets.py @@ -1,8 +1,8 @@ from django.test import TestCase -from rest_framework import status -from rest_framework.response import Response -from rest_framework.test import APIRequestFactory -from rest_framework.viewsets import GenericViewSet +from rest_framework_3 import status +from rest_framework_3.response import Response +from rest_framework_3.test import APIRequestFactory +from rest_framework_3.viewsets import GenericViewSet factory = APIRequestFactory() diff --git a/tests/test_write_only_fields.py b/tests/test_write_only_fields.py index dd3bbd6e1..ba4866baa 100644 --- a/tests/test_write_only_fields.py +++ b/tests/test_write_only_fields.py @@ -1,5 +1,5 @@ from django.test import TestCase -from rest_framework import serializers +from rest_framework_3 import serializers class WriteOnlyFieldTests(TestCase):