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

Class RegexField

object --+        
         |        
 BaseField --+    
             |    
   StringField --+
                 |
                RegexField

A subclass of StringField that validates against a regular expression. Constructor must give pattern, the regular expression against which to validate.

Instance Methods [hide private]
 
__init__(self, pattern, default='', max_length=-1)
x.__init__(...) initializes x; see help(type(x)) for signature
 
setvalue(self, value)
Set the value that this field will hold.

Inherited from BaseField: dbgetvalue, deferred, delvalue, getvalue

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

Properties [hide private]

Inherited from BaseField: value

Inherited from object: __class__

Method Details [hide private]

__init__(self, pattern, default='', max_length=-1)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setvalue(self, value)

 

Set the value that this field will hold. You should use this method to perform validation as well. Raise a TypeError if value is of the incorrect type. By default, this method stores value in self._value

Overrides: BaseField.setvalue
(inherited documentation)