diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2016-05-18 07:30:42 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-06-13 09:14:36 -0400 |
| commit | 267dc4adddd2882182f71a7f285a06b1d4b15af0 (patch) | |
| tree | 085fbeac6fa9139c5214bc16b46535cde690733d /docs/ref/forms | |
| parent | f2c0eb19e961f5864573251e70bdcdecd0250aed (diff) | |
Fixed #4136 -- Made ModelForm save empty values for nullable CharFields as NULL.
Previously, empty values were saved as strings.
Diffstat (limited to 'docs/ref/forms')
| -rw-r--r-- | docs/ref/forms/fields.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 7144a46a9d..0a5703c46e 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -361,7 +361,7 @@ For each field, we describe the default widget used if you don't specify .. class:: CharField(**kwargs) * Default widget: :class:`TextInput` - * Empty value: ``''`` (an empty string) + * Empty value: Whatever you've given as :attr:`empty_value`. * Normalizes to: A Unicode object. * Validates ``max_length`` or ``min_length``, if they are provided. Otherwise, all inputs are valid. @@ -380,6 +380,12 @@ For each field, we describe the default widget used if you don't specify If ``True`` (default), the value will be stripped of leading and trailing whitespace. + .. attribute:: empty_value + + .. versionadded:: 1.11 + + The value to use to represent "empty". Defaults to an empty string. + ``ChoiceField`` --------------- |
