Home | Trees | Indices | Help |
---|
|
object --+ | basevalidator.BaseValidator --+ | IsType
Checks that values are instances of a list of classes (not their subclasses).
For example:
>>> v = IsType (basestring) >>> v('foo') Traceback (most recent call last): ... ValueError: 'foo' type is not an instance of basestring >>> v = IsType ([basestring, str]) >>> v('foo') 'foo' >>> v(1) Traceback (most recent call last): ... ValueError: '1' type is not an instance of basestring, str
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
|
Check a value is of the desired form. This is the workhorse method that is called by validate to check passed values. As such, errors are signalled by either by throwing a meaningful exception or by returning false. This is one of the obvious and easiest places to customize behaviour by overriding in a subclass.
|
Generate an error message for a validation problem. Parameters as per raise_validation_error. Override in subclass if need be, for more specific and meaningful messages.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Jul 22 15:13:46 2011 | http://epydoc.sourceforge.net |