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

Class ARPostalCodeField

source code

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

A field that accepts a 'classic' NNNN Postal Code or a CPA.

See http://www.correoargentino.com.ar/consulta_cpa/home.php

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)
Validates that the input matches the regular expression.
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 postal ...

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 

Validates that the input matches the regular expression. Returns a Unicode object.

Overrides: newforms.fields.Field.clean
(inherited documentation)

Class Variable Details [hide private]

default_error_messages

Value:
{'invalid': ugettext("Enter a postal code in the format NNNN or ANNNNA\
AA."),}