diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-05-10 07:44:27 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-05-10 07:44:27 +0000 |
| commit | 5663258de13975e28406233328a9e51c8bc1b768 (patch) | |
| tree | 17ce8c67ca5723b24460cfa2c32a9120920f7d0b /docs/ref/forms/fields.txt | |
| parent | f824ecc363b9b83b0c98fd1b3f9704021894a1fb (diff) | |
Fixed #10792 -- Ensured that ModelChoiceFields don't provide an empty option when the underlying field has blank=False and there is a default value available. Thanks to carljm for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/forms/fields.txt')
| -rw-r--r-- | docs/ref/forms/fields.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 63ac707acf..e532971179 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -786,6 +786,10 @@ example:: # No empty label field2 = forms.ModelChoiceField(queryset=..., empty_label=None) + Note that if a ``ModelChoiceField`` is required and has a default + initial value, no empty choice is created (regardless of the value + of ``empty_label``). + ``ModelMultipleChoiceField`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
