

def clean(self, value):
    super(ZAIDField, self).clean(value)
    if (value in EMPTY_VALUES):
        return ''
    value = value.strip().replace(' ', '').replace('-', '')
    match = re.match(id_re, value)
    if (not match):
        raise ValidationError(self.error_messages['invalid'])
    g = match.groupdict()
    try:
        d = date((int(g['yy']) + 2000), int(g['mm']), int(g['dd']))
    except ValueError:
        raise ValidationError(self.error_messages['invalid'])
    if (not luhn(value)):
        raise ValidationError(self.error_messages['invalid'])
    return value

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/localflavor/za/forms.py ZAIDField.clean/original