mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 00:19:53 +03:00
compat for django 1.3x fixed
empty was introduced Django > 1.3
This commit is contained in:
parent
acaaa0384c
commit
5a9aa34415
|
@ -343,6 +343,13 @@ except ImportError:
|
||||||
kw = dict((k, int(v)) for k, v in kw.iteritems() if v is not None)
|
kw = dict((k, int(v)) for k, v in kw.iteritems() if v is not None)
|
||||||
return datetime.datetime(**kw)
|
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
|
# Markdown is optional
|
||||||
try:
|
try:
|
||||||
import markdown
|
import markdown
|
||||||
|
|
|
@ -5,9 +5,8 @@ from decimal import Decimal
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.forms import widgets
|
from django.forms import widgets
|
||||||
from django.utils.datastructures import SortedDict
|
from django.utils.datastructures import SortedDict
|
||||||
from django.utils.functional import empty
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
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:
|
# Note: We do the following so that users of the framework can use this style:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue
Block a user