diff options
| author | Tom Christie | 2013-03-05 17:50:28 +0000 | 
|---|---|---|
| committer | Tom Christie | 2013-03-05 17:50:28 +0000 | 
| commit | c20ebe95f6707d63373d9c583e90bcbc6e021899 (patch) | |
| tree | 8c51d642ef180b37f6799a45ccced9b71665fb7c /docs | |
| parent | 6e7ddd579b6604d1b0d6da8e4d09762be4520e35 (diff) | |
| parent | 5e5cd6f7f7357d68d5c10500ec0379e49d679202 (diff) | |
| download | django-rest-framework-c20ebe95f6707d63373d9c583e90bcbc6e021899.tar.bz2 | |
Merge datetime formats
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-guide/fields.md | 24 | ||||
| -rw-r--r-- | docs/api-guide/settings.md | 24 | ||||
| -rw-r--r-- | docs/topics/release-notes.md | 3 | 
3 files changed, 50 insertions, 1 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/ diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 352b1630..81ed0c84 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -42,7 +42,8 @@ You can determine your currently installed version using `pip freeze`:  ### Master -* Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior.  Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view. +* Support for custom input and output formats for `DateField`, `DateTimeField` and `TimeField` +* Cleanup: Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior.  Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view.  * Bugfix for serializer data being uncacheable with pickle protocol 0.  * Bugfixes for model field validation edge-cases.  * Bugfix for authtoken migration while using a custom user model and south.  | 
