diff options
| author | Stephan Groß | 2013-02-26 11:09:54 +0100 |
|---|---|---|
| committer | Stephan Groß | 2013-02-26 11:09:54 +0100 |
| commit | bfff356dd36f7d14d35d8a854cd314e60cf25efa (patch) | |
| tree | 665c94459adadb8533f5abf14921e9a4a4568ac4 /docs/api-guide | |
| parent | 8da83f0df9761550cbcac88850a659aab00a2506 (diff) | |
| download | django-rest-framework-bfff356dd36f7d14d35d8a854cd314e60cf25efa.tar.bz2 | |
Add better date / datetime validation (pull 2)
addition to #631 with update to master + timefield support
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/fields.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 8c28273b..a3dc4fe2 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -185,12 +185,20 @@ Corresponds to `django.forms.fields.RegexField` A date representation. +Uses `DATE_INPUT_FORMATS` to validate date. + +Optionally takes `format` as parameter to replace the matching pattern. + Corresponds to `django.db.models.fields.DateField` ## DateTimeField A date and time representation. +Uses `DATETIME_INPUT_FORMATS` to validate date_time. + +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. @@ -207,6 +215,10 @@ If you want to override this behavior, you'll need to declare the `DateTimeField A time representation. +Uses `TIME_INPUT_FORMATS` to validate time. + +Optionally takes `format` as parameter to replace the matching pattern. + Corresponds to `django.db.models.fields.TimeField` ## IntegerField |
