Ticket #9697: django-contrib-localflavor-au-taxfilenumber.patch

File django-contrib-localflavor-au-taxfilenumber.patch, 776 bytes (added by Paul Wayper, 16 years ago)

Patch in svn diff format

  • forms.py

     
    3939            return u'%s' % phone_match.group(1)
    4040        raise ValidationError(self.error_messages['invalid'])
    4141
     42class AUTaxFileNumber(RegexField):
     43    """
     44        Australian Tax File Number (TFN).
     45    """
     46    default_error_messages = {
     47        'invalid': u'Tax File Numbers must be in ###-###-### format.',
     48    }
     49
     50    def __init__(self, *args, **kwargs):
     51        super(AUTaxFileNumberField, self).__init__(
     52         r'^\d{3}-\d{3}-\d{3}$', max_length=None, min_length=None, *args, **kwargs)
     53
    4254class AUStateSelect(Select):
    4355    """
    4456    A Select widget that uses a list of Australian states/territories as its
Back to Top