mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-22 10:02:13 +03:00
add compatibility for django 1.6
This commit is contained in:
parent
b3e03cd8e2
commit
1116a534d4
|
@ -16,7 +16,7 @@ import datetime
|
|||
import inspect
|
||||
import types
|
||||
from decimal import Decimal
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
import django
|
||||
from django.core.paginator import Page
|
||||
from django.db import models
|
||||
from django.forms import widgets
|
||||
|
@ -41,6 +41,11 @@ try:
|
|||
except ImportError:
|
||||
from django.utils.datastructures import SortedDict as OrderedDict
|
||||
|
||||
if django.VERSION >= (1, 8):
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
else:
|
||||
from django.contrib.contenttypes.generic import GenericForeignKey
|
||||
|
||||
|
||||
def _resolve_model(obj):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user