diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-05 04:47:19 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-05 04:47:19 +0000 |
| commit | 4a1f2129d09658e705fbe0660275c6efccf1474a (patch) | |
| tree | 196aec05eddaacbe7b4257d20ae3b4264f035b2c /docs | |
| parent | ee48da24050a4f447f6ba153430c59b93a1522b3 (diff) | |
Fixed #12398 -- Added a TypedMultipleChoiceField. Thanks to Tai Lee.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14829 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/forms/fields.txt | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 7f18c673b6..b36c9cc749 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -361,13 +361,14 @@ Takes one extra required argument: .. class:: TypedChoiceField(**kwargs) -Just like a :class:`ChoiceField`, except :class:`TypedChoiceField` takes an -extra ``coerce`` argument. +Just like a :class:`ChoiceField`, except :class:`TypedChoiceField` takes two +extra arguments, ``coerce`` and ``empty_value``. * Default widget: ``Select`` * Empty value: Whatever you've given as ``empty_value`` - * Normalizes to: the value returned by the ``coerce`` argument. - * Validates that the given value exists in the list of choices. + * Normalizes to: A value of the type provided by the ``coerce`` argument. + * Validates that the given value exists in the list of choices and can be + coerced. * Error message keys: ``required``, ``invalid_choice`` Takes extra arguments: @@ -635,7 +636,25 @@ Takes two optional arguments for validation: of choices. * Error message keys: ``required``, ``invalid_choice``, ``invalid_list`` -Takes one extra argument, ``choices``, as for ``ChoiceField``. +Takes one extra required argument, ``choices``, as for ``ChoiceField``. + +``TypedMultipleChoiceField`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. class:: TypedMultipleChoiceField(**kwargs) + +Just like a :class:`MultipleChoiceField`, except :class:`TypedMultipleChoiceField` +takes two extra arguments, ``coerce`` and ``empty_value``. + + * Default widget: ``SelectMultiple`` + * Empty value: Whatever you've given as ``empty_value`` + * Normalizes to: A list of values of the type provided by the ``coerce`` + argument. + * Validates that the given values exists in the list of choices and can be + coerced. + * Error message keys: ``required``, ``invalid_choice`` + +Takes two extra arguments, ``coerce`` and ``empty_value``, as for ``TypedChoiceField``. ``NullBooleanField`` ~~~~~~~~~~~~~~~~~~~~ |
