Package django :: Package contrib :: Package localflavor :: Package ar :: Module forms :: Class ARCUITField
[hide private]
[frames] | no frames]

Class ARCUITField

source code

           object --+            
                    |            
newforms.fields.Field --+        
                        |        
newforms.fields.CharField --+    
                            |    
   newforms.fields.RegexField --+
                                |
                               ARCUITField

This field validates a CUIT (Código Único de Identificación Tributaria). A CUIT is of the form XX-XXXXXXXX-V. The last digit is a check digit.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
regex can be either a string or a compiled regular expression object.
source code
 
clean(self, value)
Value can be either a string in the format XX-XXXXXXXX-X or an 11-digit number.
source code
 
_canon(self, cuit) source code
 
_calc_cd(self, cuit) source code
 
_format(self, cuit, check_digit=None) source code

Inherited from newforms.fields.CharField: widget_attrs

Inherited from newforms.fields.Field: __deepcopy__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  default_error_messages = {'invalid': ugettext('Enter a valid C...

Inherited from newforms.fields.Field: creation_counter, hidden_widget, widget

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

regex can be either a string or a compiled regular expression object. error_message is an optional error message to use, if 'Enter a valid value' is too generic for you.

Overrides: object.__init__
(inherited documentation)

clean(self, value)

source code 

Value can be either a string in the format XX-XXXXXXXX-X or an 11-digit number.

Overrides: newforms.fields.Field.clean

Class Variable Details [hide private]

default_error_messages

Value:
{'invalid': ugettext('Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXX\
XXX format.'), 'checksum': ugettext("Invalid CUIT."),}