diff options
| author | Stephan Groß | 2013-03-01 16:24:25 +0100 | 
|---|---|---|
| committer | Stephan Groß | 2013-03-01 16:50:18 +0100 | 
| commit | 9c964cf37b6936e907d250306e15c3f116591e7c (patch) | |
| tree | bf78a31bfbca1ef9ae0595f7b31ce8347fc71539 /rest_framework/settings.py | |
| parent | a9d36d4726fc8eea02184b089ee6ed1d02e4c75e (diff) | |
| download | django-rest-framework-9c964cf37b6936e907d250306e15c3f116591e7c.tar.bz2 | |
Add new ISO8601 setting + integration
Diffstat (limited to 'rest_framework/settings.py')
| -rw-r--r-- | rest_framework/settings.py | 20 | 
1 files changed, 9 insertions, 11 deletions
| diff --git a/rest_framework/settings.py b/rest_framework/settings.py index 717496ea..02d751e1 100644 --- a/rest_framework/settings.py +++ b/rest_framework/settings.py @@ -18,8 +18,11 @@ 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 ISO8601  from rest_framework.compat import six @@ -79,24 +82,19 @@ DEFAULTS = {      # Input and output formats      'DATE_INPUT_FORMATS': ( -        '%Y-%m-%d',     # '1984-07-31' +        ISO8601,      ), -    'DATE_OUTPUT_FORMAT': None, +    'DATE_OUTPUT_FORMAT': ISO8601,      'DATETIME_INPUT_FORMATS': ( -        '%Y-%m-%d',              # '1984-07-31' -        '%Y-%m-%d %H:%M',        # '1984-07-31 04:31' -        '%Y-%m-%d %H:%M:%S',     # '1984-07-31 04:31:59' -        '%Y-%m-%d %H:%M:%S.%f',  # '1984-07-31 04:31:59.000200' +        ISO8601,      ), -    'DATETIME_OUTPUT_FORMAT': None, +    'DATETIME_OUTPUT_FORMAT': ISO8601,      'TIME_INPUT_FORMATS': ( -        '%H:%M',        # '04:31' -        '%H:%M:%S',     # '04:31:59' -        '%H:%M:%S.%f',  # '04:31:59.000200' +        ISO8601,      ), -    'TIME_OUTPUT_FORMAT': None, +    'TIME_OUTPUT_FORMAT': ISO8601,  } | 
