From 9c964cf37b6936e907d250306e15c3f116591e7c Mon Sep 17 00:00:00 2001 From: Stephan Groß Date: Fri, 1 Mar 2013 16:24:25 +0100 Subject: Add new ISO8601 setting + integration --- rest_framework/settings.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'rest_framework/settings.py') 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, } -- cgit v1.2.3