Remove ContentType import fallback

This commit is contained in:
Carlton Gibson 2015-09-22 15:55:39 +02:00
parent 5c0dffa4f7
commit 68c88e180f
2 changed files with 3 additions and 11 deletions

View File

@ -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

View File

@ -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