aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide
diff options
context:
space:
mode:
authorTom Christie2013-03-05 17:50:28 +0000
committerTom Christie2013-03-05 17:50:28 +0000
commitc20ebe95f6707d63373d9c583e90bcbc6e021899 (patch)
tree8c51d642ef180b37f6799a45ccced9b71665fb7c /docs/api-guide
parent6e7ddd579b6604d1b0d6da8e4d09762be4520e35 (diff)
parent5e5cd6f7f7357d68d5c10500ec0379e49d679202 (diff)
downloaddjango-rest-framework-c20ebe95f6707d63373d9c583e90bcbc6e021899.tar.bz2
Merge datetime formats
Diffstat (limited to 'docs/api-guide')
-rw-r--r--docs/api-guide/fields.md24
-rw-r--r--docs/api-guide/settings.md24
2 files changed, 48 insertions, 0 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md
index d7f9197f..c1f3c051 100644
--- a/docs/api-guide/fields.md
+++ b/docs/api-guide/fields.md
@@ -185,12 +185,22 @@ Corresponds to `django.forms.fields.RegexField`
A date representation.
+Optionally takes `format` as parameter to replace the matching pattern.
+
Corresponds to `django.db.models.fields.DateField`
+**Signature:** `DateField(input_formats=None, output_format=False)`
+
+ - `input_formats` designates which input formats are supported. This will override the `DATE_INPUT_FORMATS`
+
+ - `output_format` designates which output format will be used. This will override the `DATE_OUTPUT_FORMAT`
+
## DateTimeField
A date and time representation.
+Optionally takes `format` as parameter to replace the matching pattern.
+
Corresponds to `django.db.models.fields.DateTimeField`
When using `ModelSerializer` or `HyperlinkedModelSerializer`, note that any model fields with `auto_now=True` or `auto_now_add=True` will use serializer fields that are `read_only=True` by default.
@@ -203,12 +213,26 @@ If you want to override this behavior, you'll need to declare the `DateTimeField
class Meta:
model = Comment
+**Signature:** `DateTimeField(input_formats=None, output_format=False)`
+
+ - `input_formats` designates which input formats are supported. This will override the `DATETIME_INPUT_FORMATS`
+
+ - `output_format` designates which output format will be used. This will override the `DATETIME_OUTPUT_FORMAT`
+
## TimeField
A time representation.
+Optionally takes `format` as parameter to replace the matching pattern.
+
Corresponds to `django.db.models.fields.TimeField`
+**Signature:** `TimeField(input_formats=None, output_format=False)`
+
+ - `input_formats` designates which input formats are supported. This will override the `TIME_INPUT_FORMATS`
+
+ - `output_format` designates which output format will be used. This will override the `TIME_OUTPUT_FORMAT`
+
## IntegerField
An integer representation.
diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md
index e103fbab..04569f44 100644
--- a/docs/api-guide/settings.md
+++ b/docs/api-guide/settings.md
@@ -174,4 +174,28 @@ The name of a parameter in the URL conf that may be used to provide a format suf
Default: `'format'`
+## DATE_INPUT_FORMATS
+
+Default: `ISO8601`
+
+## DATE_OUTPUT_FORMAT
+
+Default: `ISO8601`
+
+## DATETIME_INPUT_FORMATS
+
+Default: `ISO8601`
+
+## DATETIME_OUTPUT_FORMAT
+
+Default: `ISO8601`
+
+## TIME_INPUT_FORMATS
+
+Default: `ISO8601`
+
+## TIME_OUTPUT_FORMAT
+
+Default: `ISO8601`
+
[cite]: http://www.python.org/dev/peps/pep-0020/