From cef22390862a2ad9ecdfbe3fabc74fbd81160b39 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sun, 25 Feb 2007 17:16:38 +0000 Subject: Fixed #2104: allow somewhat nicer error messages in RequiredIfOtherFieldEquals validator. Thanks, Steven Armstrong git-svn-id: http://code.djangoproject.com/svn/django/trunk@4577 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/forms.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/forms.txt b/docs/forms.txt index fc10e3f17a..8c40eeb997 100644 --- a/docs/forms.txt +++ b/docs/forms.txt @@ -608,6 +608,10 @@ fails. If no message is passed in, a default message is used. order). If the given field does (or does not have, in the latter case) the given value, then the current field being validated is required. + An optional ``other_label`` argument can be passed which, if given, is used + in error messages instead of the value. This allows more user friendly error + messages if the value itself is not descriptive enough. + Note that because validators are called before any ``do_html2python()`` functions, the value being compared against is a string. So ``RequiredIfOtherFieldEquals('choice', '1')`` is correct, whilst -- cgit v1.3