Package django :: Package newforms :: Module fields :: Class RegexField
[hide private]
[frames] | no frames]

Class RegexField

source code

object --+        
         |        
     Field --+    
             |    
     CharField --+
                 |
                RegexField

Instance Methods [hide private]
 
__init__(self, regex, max_length=None, min_length=None, error_message=None, *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 CharField: widget_attrs

Inherited from Field: __deepcopy__

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

Class Variables [hide private]

Inherited from CharField: default_error_messages

Inherited from Field: creation_counter, hidden_widget, widget

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, regex, max_length=None, min_length=None, error_message=None, *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: CharField.__init__

clean(self, value)

source code 

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

Overrides: CharField.clean