diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-05-12 02:36:05 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-05-12 02:36:05 +0000 |
| commit | 415e84ad53e0d0d8f7df87784c1893489bdbe0b8 (patch) | |
| tree | 09541f8319c45ec51fb44154534abc41cb86aee9 /docs/forms.txt | |
| parent | 4938c8ea6db6f23ebb0883b8a092985344508b25 (diff) | |
newforms-admin: Merged to [5194]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/forms.txt')
| -rw-r--r-- | docs/forms.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/forms.txt b/docs/forms.txt index ce1010235f..329e84a1b1 100644 --- a/docs/forms.txt +++ b/docs/forms.txt @@ -517,7 +517,7 @@ to put punctuation at the end of your validation messages. When are validators called? --------------------------- -After a form has been submitted, Django validates each field in turn. First, +After a form has been submitted, Django validates each field in turn. First, if the field is required, Django checks that it is present and non-empty. Then, if that test passes *and the form submission contained data* for that field, all the validators for that field are called in turn. The emphasized portion in the @@ -615,15 +615,19 @@ fails. If no message is passed in, a default message is used. ``other_value``, then the validators in ``validator_list`` are all run against the current field. +``RequiredIfOtherFieldGiven`` + Takes a field name of the current field is only required if the other + field has a value. + +``RequiredIfOtherFieldsGiven`` + Similar to ``RequiredIfOtherFieldGiven``, except that it takes a list of + field names and if any one of the supplied fields has a value provided, + the current field being validated is required. + ``RequiredIfOtherFieldNotGiven`` Takes the name of the other field and this field is only required if the other field has no value. -``RequiredIfOtherFieldsNotGiven`` - Similar to ``RequiredIfOtherFieldNotGiven``, except that it takes a list - of field names and if any one of the supplied fields does not have a value - provided, the field being validated is required. - ``RequiredIfOtherFieldEquals`` and ``RequiredIfOtherFieldDoesNotEqual`` Each of these validator classes takes a field name and a value (in that order). If the given field does (or does not have, in the latter case) the @@ -650,8 +654,8 @@ fails. If no message is passed in, a default message is used. ``NumberIsInRange`` Takes two boundary numbers, ``lower`` and ``upper``, and checks that the field is greater than ``lower`` (if given) and less than ``upper`` (if - given). - + given). + Both checks are inclusive. That is, ``NumberIsInRange(10, 20)`` will allow values of both 10 and 20. This validator only checks numeric values (e.g., float and integer values). @@ -691,5 +695,5 @@ fails. If no message is passed in, a default message is used. document for more details). .. _`generic views`: ../generic_views/ -.. _`models API`: ../model_api/ +.. _`models API`: ../model-api/ .. _settings: ../settings/ |
