Fix imports for DRF 3.10 (#408)

Fixes #410
Fixes #411
This commit is contained in:
tfranzel
2019-07-16 19:39:44 +02:00
committed by Cristi Vîjdea
parent 1e380fe68b
commit 1904b0499e
4 changed files with 22 additions and 4 deletions
+11 -2
View File
@@ -4,14 +4,23 @@ import re
from collections import OrderedDict, defaultdict
import uritemplate
import rest_framework
from coreapi.compat import urlparse
from rest_framework import versioning
from rest_framework.compat import URLPattern, URLResolver, get_original_route
from rest_framework.schemas.generators import EndpointEnumerator as _EndpointEnumerator
from rest_framework.schemas.generators import SchemaGenerator, endpoint_ordering, get_pk_name
from rest_framework.schemas.inspectors import get_pk_description
from rest_framework.schemas.generators import endpoint_ordering, get_pk_name
from rest_framework.settings import api_settings
from packaging.version import Version
if Version(rest_framework.__version__) < Version('3.10'):
from rest_framework.schemas.generators import SchemaGenerator
from rest_framework.schemas.inspectors import get_pk_description
else:
from rest_framework.schemas import SchemaGenerator
from rest_framework.schemas.utils import get_pk_description
from . import openapi
from .app_settings import swagger_settings
from .errors import SwaggerGenerationError