diff options
| author | Stephan Groß | 2013-03-01 16:24:25 +0100 |
|---|---|---|
| committer | Stephan Groß | 2013-03-01 16:24:25 +0100 |
| commit | 29a54b5a773c0bc854a57393364437efd2c7a172 (patch) | |
| tree | d4fda120088cb4825db50b42e97a980a858ef0d4 /rest_framework/settings.py | |
| parent | 7e702439eb4a82fe2ef45911fbb176e95d5f0bce (diff) | |
| download | django-rest-framework-29a54b5a773c0bc854a57393364437efd2c7a172.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, } |
