Django

Code

Show
Ignore:
Timestamp:
12/17/07 02:05:27 (1 year ago)
Author:
mtredinnick
Message:

Fixed #5871 -- Factored out the validation errors in localflavor form fields. Brings them into line with the standard newforms fields. Patch from Jan Rademaker.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/localflavor/jp/forms.py

    r5876 r6926  
    1616    Accepts 7 digits, with or without a hyphen. 
    1717    """ 
     18    default_error_messages = { 
     19        'invalid': ugettext('Enter a postal code in the format XXXXXXX or XXX-XXXX.'), 
     20    } 
     21 
    1822    def __init__(self, *args, **kwargs): 
    1923        super(JPPostalCodeField, self).__init__(r'^\d{3}-\d{4}$|^\d{7}$', 
    20             max_length=None, min_length=None, 
    21             error_message=ugettext('Enter a postal code in the format XXXXXXX or XXX-XXXX.'), 
    22                     *args, **kwargs) 
     24            max_length=None, min_length=None, *args, **kwargs) 
    2325 
    2426    def clean(self, value):