mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-13 09:42:27 +03:00
fixes broken test + importlib warnings
This commit is contained in:
parent
47c61679a5
commit
b3e03cd8e2
|
@ -16,7 +16,7 @@ import datetime
|
|||
import inspect
|
||||
import types
|
||||
from decimal import Decimal
|
||||
from django.contrib.contenttypes.generic import GenericForeignKey
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.core.paginator import Page
|
||||
from django.db import models
|
||||
from django.forms import widgets
|
||||
|
@ -114,6 +114,9 @@ class OrderedDictWithMetadata(OrderedDict):
|
|||
"""
|
||||
A sorted dict-like object, that can have additional properties attached.
|
||||
"""
|
||||
def __reduce__(self):
|
||||
return self.__class__, (OrderedDict(self), )
|
||||
|
||||
def __getstate__(self):
|
||||
"""
|
||||
Used by pickle (e.g., caching).
|
||||
|
|
|
@ -19,9 +19,14 @@ back to the defaults.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
from django.conf import settings
|
||||
from django.utils import importlib, six
|
||||
from django.utils import six
|
||||
from rest_framework import ISO_8601
|
||||
|
||||
try:
|
||||
import importlib
|
||||
except ImportError:
|
||||
from django.utils import importlib
|
||||
|
||||
|
||||
USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user