'Value can be a string either in the [X]X.XXX.XXX or [X]XXXXXXX formats.'

def clean(self, value):

    value = super(ARDNIField, self).clean(value)
    if (value in EMPTY_VALUES):
        return u''
    if (not value.isdigit()):
        value = value.replace('.', '')
    if (not value.isdigit()):
        raise ValidationError(self.error_messages['invalid'])
    if (len(value) not in (7, 8)):
        raise ValidationError(self.error_messages['max_digits'])
    return value
