mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Remove include compat
This commit is contained in:
parent
a65f1418b7
commit
bfb5119926
|
@ -305,15 +305,6 @@ def set_rollback():
|
|||
pass
|
||||
|
||||
|
||||
# TODO: Remove
|
||||
def include(module, namespace=None, app_name=None):
|
||||
from django.conf.urls import include
|
||||
if django.VERSION < (1,9):
|
||||
return include(module, namespace, app_name)
|
||||
else:
|
||||
return include((module, app_name), namespace)
|
||||
|
||||
|
||||
def authenticate(request=None, **credentials):
|
||||
from django.contrib.auth import authenticate
|
||||
if django.VERSION < (1, 11):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from rest_framework.compat import RegexURLResolver, include
|
||||
from rest_framework.compat import RegexURLResolver
|
||||
from rest_framework.settings import api_settings
|
||||
|
||||
|
||||
|
@ -19,8 +19,7 @@ def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
|
|||
patterns = apply_suffix_patterns(urlpattern.url_patterns,
|
||||
suffix_pattern,
|
||||
suffix_required)
|
||||
ret.append(url(regex, include(patterns, namespace, app_name), kwargs))
|
||||
|
||||
ret.append(url(regex, include((patterns, app_name), namespace), kwargs))
|
||||
else:
|
||||
# Regular URL pattern
|
||||
regex = urlpattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern
|
||||
|
|
|
@ -3,13 +3,12 @@ from __future__ import unicode_literals
|
|||
from collections import namedtuple
|
||||
|
||||
import pytest
|
||||
from django.conf.urls import url
|
||||
from django.conf.urls import include, url
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import models
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
from rest_framework import permissions, serializers, viewsets
|
||||
from rest_framework.compat import include
|
||||
from rest_framework.decorators import detail_route, list_route
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.routers import DefaultRouter, SimpleRouter
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import pytest
|
||||
from django.conf.urls import url
|
||||
from django.conf.urls import include, url
|
||||
from django.test import override_settings
|
||||
|
||||
from rest_framework import serializers, status, versioning
|
||||
from rest_framework.compat import include
|
||||
from rest_framework.decorators import APIView
|
||||
from rest_framework.relations import PKOnlyObject
|
||||
from rest_framework.response import Response
|
||||
|
|
Loading…
Reference in New Issue
Block a user