Back to index

plone3  3.1.7
_validator.py
Go to the documentation of this file.
00001 """Interfaces for validation subscription adapters. Provide one of these to
00002 perform pre- and post- validation on save.
00003 
00004 If you're not familiar with subscription adapters, see zope.component's
00005 README.txt and interfaces.py.
00006 """
00007     
00008 from zope.interface import Interface
00009 
00010 class IObjectValidation(Interface):
00011     """Pre- or post-validate an Archetypes object (common base interface)
00012     
00013     Will be called as a subscription adapter during validation.
00014     """
00015     
00016     def __call__(request):
00017         """Validate the context object. Return a dict with keys of fieldnames
00018         and values of error strings.
00019         """
00020 
00021 class IObjectPreValidation(IObjectValidation):
00022     """Validate before schema validation
00023     """
00024     
00025 class IObjectPostValidation(IObjectValidation):
00026     """Validate after schema validation
00027     """
00028