Ticket #6291: 6291.diff
File 6291.diff, 1.4 KB (added by , 17 years ago) |
---|
-
django/contrib/localflavor/ca/forms.py
80 80 81 81 Checks the following rules to determine whether the number is valid: 82 82 83 * Conforms to the XXX-XXX-XXX Xformat.83 * Conforms to the XXX-XXX-XXX format. 84 84 * Passes the check digit process "Luhn Algorithm" 85 85 See: http://en.wikipedia.org/wiki/Social_Insurance_Number 86 86 """ 87 87 default_error_messages = { 88 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX Xformat.'),88 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'), 89 89 } 90 90 91 91 def clean(self, value): -
docs/localflavor.txt
181 181 ---------------------------- 182 182 183 183 A form field that validates input as a Canadian Social Insurance Number (SIN). 184 A valid number must have the format XXX-XXX-XXX Xand pass a `Luhn mod-10184 A valid number must have the format XXX-XXX-XXX and pass a `Luhn mod-10 185 185 checksum`_. 186 186 187 187 .. _Luhn mod-10 checksum: http://en.wikipedia.org/wiki/Luhn_algorithm