def clean(self, value):

        value = super(UYCIField, self).clean(value)
        if value in EMPTY_VALUES:
            return ''
        match = self.regex.match(value)
        if not match:
            raise ValidationError(self.error_messages['invalid'])

        number = int(match.group('num').replace('.', ''))
        validation_digit = int(match.group('val'))

        if not validation_digit == get_validation_digit(number):
            raise ValidationError(self.error_messages['invalid_validation_digit'])

        return value
Validates format and validation digit.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/localflavor/uy/forms.py/UYCIField.clean