#NEWLINE# def clean( self , value ) : #NEWLINE# #INDENT# '\n        Value must be an 11-digit number.\n        ' #NEWLINE# value = super ( PERUCField , self ) . clean ( value ) #NEWLINE# if ( value in EMPTY_VALUES ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# if ( not value . isdigit ( ) ) : #NEWLINE# #INDENT# raise ValidationError ( value . error_messages [ 'invalid' ] ) #NEWLINE# #UNINDENT# if ( len ( value ) != 11 ) : #NEWLINE# #INDENT# raise ValidationError ( self . error_messages [ 'max_digits' ] ) #NEWLINE# #UNINDENT# return value