mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Remove ContentType import fallback
This commit is contained in:
parent
5c0dffa4f7
commit
68c88e180f
|
@ -90,16 +90,6 @@ except ImportError:
|
|||
from django.db.models import get_model
|
||||
|
||||
|
||||
# Import path changes from 1.7 onwards.
|
||||
try:
|
||||
from django.contrib.contenttypes.fields import (
|
||||
GenericForeignKey, GenericRelation
|
||||
)
|
||||
except ImportError:
|
||||
from django.contrib.contenttypes.generic import (
|
||||
GenericForeignKey, GenericRelation
|
||||
)
|
||||
|
||||
# django-filter is optional
|
||||
try:
|
||||
import django_filters
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.contenttypes.fields import (
|
||||
GenericForeignKey, GenericRelation
|
||||
)
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
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.compat import GenericForeignKey, GenericRelation
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
|
|
Loading…
Reference in New Issue
Block a user