Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
Archetypes.tests.test_fieldvalidation.MyValidator Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 name
 fun

Static Private Attributes

tuple __implements__ = (IValidator,)

Detailed Description

Definition at line 36 of file test_fieldvalidation.py.


Constructor & Destructor Documentation

Definition at line 39 of file test_fieldvalidation.py.

00039 
00040     def __init__(self, name, fun):
00041         self.name = name
00042         self.fun = fun

Here is the caller graph for this function:


Member Function Documentation

def Archetypes.tests.test_fieldvalidation.MyValidator.__call__ (   self,
  value,
  instance,
  field,
  args,
  kwargs 
)

Definition at line 43 of file test_fieldvalidation.py.

00043 
00044     def __call__(self, value, instance, field, *args, **kwargs):
00045         return self.fun(value)
00046 
00047 # never validates
00048 validationService.register(MyValidator('v1', lambda val:val))
00049 # always validates
00050 validationService.register(MyValidator('v2', lambda val:1))
00051 # never validates
00052 validationService.register(MyValidator('v3', lambda val:[]))

Here is the caller graph for this function:


Member Data Documentation

Definition at line 37 of file test_fieldvalidation.py.

Definition at line 41 of file test_fieldvalidation.py.

Definition at line 40 of file test_fieldvalidation.py.


The documentation for this class was generated from the following file: