mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 14:24:48 +03:00
'django.contrib.contenttypes.generic' was replaced by 'django.contrib.contenttypes.fields'
for backwards compatibility, also import from the old location
This commit is contained in:
parent
c28bc9896e
commit
8b390da876
|
@ -1,8 +1,15 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.contrib.contenttypes.generic import (
|
try:
|
||||||
GenericForeignKey, GenericRelation
|
from django.contrib.contenttypes.fields import (
|
||||||
)
|
GenericForeignKey, GenericRelation
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
# in Django 1.6 and earlier, this was in generic
|
||||||
|
from django.contrib.contenttypes.generic import (
|
||||||
|
GenericForeignKey, GenericRelation
|
||||||
|
)
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
Loading…
Reference in New Issue
Block a user