diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 09b763681..b09487f38 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -343,6 +343,13 @@ except ImportError: kw = dict((k, int(v)) for k, v in kw.iteritems() if v is not None) return datetime.datetime(**kw) + +# empty does not exist in 1.3x +if django.VERSION >= (1, 4): + from django.utils.functional import empty +else: + empty = object() + # Markdown is optional try: import markdown diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 80437952f..80eefbf08 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -5,9 +5,8 @@ from decimal import Decimal from django.db import models from django.forms import widgets from django.utils.datastructures import SortedDict -from django.utils.functional import empty from django.core.exceptions import ImproperlyConfigured -from rest_framework.compat import get_concrete_model +from rest_framework.compat import get_concrete_model, empty # Note: We do the following so that users of the framework can use this style: #