mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Update documentation to include iso-8601-strict
This commit is contained in:
parent
87440e73a1
commit
f2cb74edde
|
@ -299,7 +299,7 @@ Corresponds to `django.db.models.fields.DateTimeField`.
|
||||||
|
|
||||||
#### `DateTimeField` format strings.
|
#### `DateTimeField` format strings.
|
||||||
|
|
||||||
Format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used. (eg `'2013-01-29T12:34:56.000000Z'`)
|
Format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special strings `'iso-8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used (eg `'2013-01-29T12:34:56.000000Z'`), and `'iso-8601-strict'`, which indicates that [ISO 8601][iso8601] style datetimes without fraction seconds should be used (eg `'2013-01-29T12:34:56Z'`)
|
||||||
|
|
||||||
When a value of `None` is used for the format `datetime` objects will be returned by `to_representation` and the final output representation will determined by the renderer class.
|
When a value of `None` is used for the format `datetime` objects will be returned by `to_representation` and the final output representation will determined by the renderer class.
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ Corresponds to `django.db.models.fields.TimeField`
|
||||||
|
|
||||||
#### `TimeField` format strings
|
#### `TimeField` format strings
|
||||||
|
|
||||||
Format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style times should be used. (eg `'12:34:56.000000'`)
|
Format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special strings `'iso-8601'`, which indicates that [ISO 8601][iso8601] style times should be used (eg `'12:34:56.000000'`), and `'iso-8601-strict'`, which indicates that [ISO 8601][iso8601] style times without fractional seconds should be used (eg `'12:34:56'`).
|
||||||
|
|
||||||
## DurationField
|
## DurationField
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ Default: `'format'`
|
||||||
|
|
||||||
A format string that should be used by default for rendering the output of `DateTimeField` serializer fields. If `None`, then `DateTimeField` serializer fields will return Python `datetime` objects, and the datetime encoding will be determined by the renderer.
|
A format string that should be used by default for rendering the output of `DateTimeField` serializer fields. If `None`, then `DateTimeField` serializer fields will return Python `datetime` objects, and the datetime encoding will be determined by the renderer.
|
||||||
|
|
||||||
May be any of `None`, `'iso-8601'` or a Python [strftime format][strftime] string.
|
May be any of `None`, `'iso-8601'`, `'iso-8601-strict'`, or a Python [strftime format][strftime] string.
|
||||||
|
|
||||||
Default: `'iso-8601'`
|
Default: `'iso-8601'`
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ Default: `'iso-8601'`
|
||||||
|
|
||||||
A list of format strings that should be used by default for parsing inputs to `DateTimeField` serializer fields.
|
A list of format strings that should be used by default for parsing inputs to `DateTimeField` serializer fields.
|
||||||
|
|
||||||
May be a list including the string `'iso-8601'` or Python [strftime format][strftime] strings.
|
May be a list including the string `'iso-8601'`, `'iso-8601-strict'` or Python [strftime format][strftime] strings.
|
||||||
|
|
||||||
Default: `['iso-8601']`
|
Default: `['iso-8601']`
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ Default: `['iso-8601']`
|
||||||
|
|
||||||
A format string that should be used by default for rendering the output of `TimeField` serializer fields. If `None`, then `TimeField` serializer fields will return Python `time` objects, and the time encoding will be determined by the renderer.
|
A format string that should be used by default for rendering the output of `TimeField` serializer fields. If `None`, then `TimeField` serializer fields will return Python `time` objects, and the time encoding will be determined by the renderer.
|
||||||
|
|
||||||
May be any of `None`, `'iso-8601'` or a Python [strftime format][strftime] string.
|
May be any of `None`, `'iso-8601'`, `'iso-8601-strict'` or a Python [strftime format][strftime] string.
|
||||||
|
|
||||||
Default: `'iso-8601'`
|
Default: `'iso-8601'`
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ Default: `'iso-8601'`
|
||||||
|
|
||||||
A list of format strings that should be used by default for parsing inputs to `TimeField` serializer fields.
|
A list of format strings that should be used by default for parsing inputs to `TimeField` serializer fields.
|
||||||
|
|
||||||
May be a list including the string `'iso-8601'` or Python [strftime format][strftime] strings.
|
May be a list including the string `'iso-8601'`, `'iso-8601-strict'` or Python [strftime format][strftime] strings.
|
||||||
|
|
||||||
Default: `['iso-8601']`
|
Default: `['iso-8601']`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user