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/api-guide/fields.md | |
| parent | 6e7ddd579b6604d1b0d6da8e4d09762be4520e35 (diff) | |
| parent | 5e5cd6f7f7357d68d5c10500ec0379e49d679202 (diff) | |
| download | django-rest-framework-c20ebe95f6707d63373d9c583e90bcbc6e021899.tar.bz2 | |
Merge datetime formats
Diffstat (limited to 'docs/api-guide/fields.md')
| -rw-r--r-- | docs/api-guide/fields.md | 24 | 
1 files changed, 24 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.  | 
