aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/settings.py
diff options
context:
space:
mode:
authorTom Christie2013-03-18 21:03:05 +0000
committerTom Christie2013-03-18 21:03:05 +0000
commit74fb366c595db87bb71baeffcacfb7d2482e3a18 (patch)
tree2e28cb52542742f32cdd3fbeb625f7f59cba0a3f /rest_framework/settings.py
parent4c6396108704d38f534a16577de59178b1d0df3b (diff)
parent034c4ce4081dd6d15ea47fb8318754321a3faf0c (diff)
downloaddjango-rest-framework-74fb366c595db87bb71baeffcacfb7d2482e3a18.tar.bz2
Merge branch 'master' into resources-routers
Diffstat (limited to 'rest_framework/settings.py')
-rw-r--r--rest_framework/settings.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/rest_framework/settings.py b/rest_framework/settings.py
index 5c77c55c..eede0c5a 100644
--- a/rest_framework/settings.py
+++ b/rest_framework/settings.py
@@ -17,9 +17,14 @@ This module provides the `api_setting` object, that is used to access
REST framework settings, checking for user settings first, then falling
back to the defaults.
"""
+from __future__ import unicode_literals
+
from django.conf import settings
from django.utils import importlib
+from rest_framework import ISO_8601
+from rest_framework.compat import six
+
USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None)
@@ -74,6 +79,22 @@ DEFAULTS = {
'URL_FORMAT_OVERRIDE': 'format',
'FORMAT_SUFFIX_KWARG': 'format',
+
+ # Input and output formats
+ 'DATE_INPUT_FORMATS': (
+ ISO_8601,
+ ),
+ 'DATE_FORMAT': ISO_8601,
+
+ 'DATETIME_INPUT_FORMATS': (
+ ISO_8601,
+ ),
+ 'DATETIME_FORMAT': ISO_8601,
+
+ 'TIME_INPUT_FORMATS': (
+ ISO_8601,
+ ),
+ 'TIME_FORMAT': ISO_8601,
}
@@ -98,7 +119,7 @@ def perform_import(val, setting_name):
If the given setting is a string import notation,
then perform the necessary import or imports.
"""
- if isinstance(val, basestring):
+ if isinstance(val, six.string_types):
return import_from_string(val, setting_name)
elif isinstance(val, (list, tuple)):
return [import_from_string(item, setting_name) for item in val]