Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed up some omissions and one mysteriously documented, yet non-exis…

…tent field

in the validator documentation. Patch from alang@bright-green.com. Refs #2266.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ec577d88eaf4093725fb78e50be7756f27b5d5d0 1 parent 8a4a802
Malcolm Tredinnick authored April 27, 2007

Showing 2 changed files with 13 additions and 8 deletions. Show diff stats Hide diff stats

  1. 1  AUTHORS
  2. 20  docs/forms.txt
1  AUTHORS
@@ -42,6 +42,7 @@ people who have submitted patches, reported bugs, added translations, helped
42 42
 answer newbie questions, and generally made Django that much better:
43 43
 
44 44
     adurdin@gmail.com
  45
+    alang@bright-green.com
45 46
     Daniel Alves Barbosa de Oliveira Vaz <danielvaz@gmail.com>
46 47
     Andreas
47 48
     andy@jadedplanet.net
20  docs/forms.txt
@@ -517,7 +517,7 @@ to put punctuation at the end of your validation messages.
517 517
 When are validators called?
518 518
 ---------------------------
519 519
 
520  
-After a form has been submitted, Django validates each field in turn. First, 
  520
+After a form has been submitted, Django validates each field in turn. First,
521 521
 if the field is required, Django checks that it is present and non-empty. Then,
522 522
 if that test passes *and the form submission contained data* for that field, all
523 523
 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.
615 615
     ``other_value``, then the validators in ``validator_list`` are all run
616 616
     against the current field.
617 617
 
  618
+``RequiredIfOtherFieldGiven``
  619
+    Takes a field name of the current field is only required if the other
  620
+    field has a value.
  621
+
  622
+``RequiredIfOtherFieldsGiven``
  623
+    Similar to ``RequiredIfOtherFieldGiven``, except that it takes a list of
  624
+    field names and if any one of the supplied fields has a value provided,
  625
+    the current field being validated is required.
  626
+
618 627
 ``RequiredIfOtherFieldNotGiven``
619 628
     Takes the name of the other field and this field is only required if the
620 629
     other field has no value.
621 630
 
622  
-``RequiredIfOtherFieldsNotGiven``
623  
-    Similar to ``RequiredIfOtherFieldNotGiven``, except that it takes a list
624  
-    of field names and if any one of the supplied fields does not have a value
625  
-    provided, the field being validated is required.
626  
-
627 631
 ``RequiredIfOtherFieldEquals`` and ``RequiredIfOtherFieldDoesNotEqual``
628 632
     Each of these validator classes takes a field name and a value (in that
629 633
     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.
650 654
 ``NumberIsInRange``
651 655
     Takes two boundary numbers, ``lower`` and ``upper``, and checks that the
652 656
     field is greater than ``lower`` (if given) and less than ``upper`` (if
653  
-    given).  
654  
-    
  657
+    given).
  658
+
655 659
     Both checks are inclusive. That is, ``NumberIsInRange(10, 20)`` will allow
656 660
     values of both 10 and 20. This validator only checks numeric values
657 661
     (e.g., float and integer values).

0 notes on commit ec577d8

Please sign in to comment.
Something went wrong with that request. Please try again.