This commit is contained in:
Asif Saifuddin Auvi 2016-06-04 20:18:16 +00:00
commit 6413937a46
2 changed files with 2 additions and 8 deletions

View File

@ -128,13 +128,6 @@ def value_from_object(field, obj):
field.value_from_object(obj) field.value_from_object(obj)
# contrib.postgres only supported from 1.8 onwards.
try:
from django.contrib.postgres import fields as postgres_fields
except ImportError:
postgres_fields = None
# JSONField is only supported from 1.9 onwards # JSONField is only supported from 1.9 onwards
try: try:
from django.contrib.postgres.fields import JSONField from django.contrib.postgres.fields import JSONField

View File

@ -14,6 +14,7 @@ from __future__ import unicode_literals
import warnings import warnings
from django.contrib.postgres import fields as postgres_fields
from django.db import models from django.db import models
from django.db.models import DurationField as ModelDurationField from django.db.models import DurationField as ModelDurationField
from django.db.models.fields import Field as DjangoModelField from django.db.models.fields import Field as DjangoModelField
@ -22,7 +23,7 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from rest_framework.compat import JSONField as ModelJSONField from rest_framework.compat import JSONField as ModelJSONField
from rest_framework.compat import postgres_fields, unicode_to_repr from rest_framework.compat import unicode_to_repr
from rest_framework.utils import model_meta from rest_framework.utils import model_meta
from rest_framework.utils.field_mapping import ( from rest_framework.utils.field_mapping import (
ClassLookupDict, get_field_kwargs, get_nested_relation_kwargs, ClassLookupDict, get_field_kwargs, get_nested_relation_kwargs,