Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(30)  |  Call(21)  |  Derive(0)  |  Import(9)

src/e/e/eea.relations-6.7/eea/relations/field/referencefield.py   eea.relations(Download)
""" Reference field
"""
from Products.validation import ValidationChain
from Products.Archetypes.atapi import ReferenceField
 
    def validate_relations(self, value, instance, errors=None, **kwargs):
        """ Validate relations
        """
        chainname = 'Validator_%s' % self.getName()
        validators = ValidationChain(chainname,
                                     validators=('eea.relations.required',))
        result = validators(value, instance=instance,

src/p/r/Products.ATExtensions-1.1/Products/ATExtensions/field/record.py   Products.ATExtensions(Download)
# we have to define our own validation handling
try:
    from Products.validation import ValidationChain
    from Products.validation import UnknowValidatorError
    from Products.validation import FalseValidatorError
                validators = current_validators
            elif providedBy(IValidator, current_validators):
                validators = ValidationChain(chainname, validators=current_validators)
            elif type(current_validators) in (TupleType, ListType, StringType):
                if len(current_validators):
                    # got a non empty list or string - create a chain
                    try:
                        validators = ValidationChain(chainname, validators=current_validators)
            if not subfield in self.required_subfields:
                if validators == ():
                    validators = ValidationChain(chainname)
                if len(validators):
                    # insert isEmpty validator at position 0 if first validator

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/Field.py   Products.Archetypes(Download)
from Products.Archetypes.Registry import registerPropertyType
 
from Products.validation import ValidationChain
from Products.validation import UnknowValidatorError
from Products.validation import FalseValidatorError
            validators = self.validators
        elif IValidator.providedBy(self.validators):
            validators = ValidationChain(chainname, validators=self.validators)
        elif isinstance(self.validators, (tuple, list, basestring)):
            if len(self.validators):
                # got a non empty list or string - create a chain
                try:
                    validators = ValidationChain(chainname, validators=self.validators)
        if not self.required:
            if validators == ():
                validators = ValidationChain(chainname)
            if len(validators):
                # insert isEmpty validator at position 0 if first validator

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/Field.py   Products.Archetypes(Download)
from Products.Archetypes.Registry import registerPropertyType
 
from Products.validation import ValidationChain
from Products.validation import UnknowValidatorError
from Products.validation import FalseValidatorError
            validators = self.validators
        elif IValidator.providedBy(self.validators):
            validators = ValidationChain(chainname, validators=self.validators)
        elif isinstance(self.validators, (tuple, list, basestring)):
            if len(self.validators):
                # got a non empty list or string - create a chain
                try:
                    validators = ValidationChain(chainname, validators=self.validators)
        if not self.required:
            if validators == ():
                validators = ValidationChain(chainname)
            if len(validators):
                # insert isEmpty validator at position 0 if first validator

src/p/r/Products.ATExtensions-1.1/Products/ATExtensions/config.py   Products.ATExtensions(Download)
 
try:
    from Products.validation import ValidationChain
    HAS_VALIDATION_CHAIN = 1
except ImportError:

src/s/i/simplelayout.types.common-3.0.3/simplelayout/types/common/content/simplelayout_schemas.py   simplelayout.types.common(Download)
from simplelayout.types.common.config import ORIGINAL_SIZE
from Products.ATContentTypes import ATCTMessageFactory as _
from Products.CMFCore.permissions import ManagePortal
from Products.validation import ValidationChain
from Products.ATContentTypes.content.schemata import finalizeATCTSchema, marshall_register

src/p/r/Products.ATContentTypes-2.2.1/Products/ATContentTypes/tests/utils.py   Products.ATContentTypes(Download)
    obj.setRights('GPL')
 
from Products.validation import ValidationChain
EmptyValidator = ValidationChain('isEmpty')
EmptyValidator.appendSufficient('isEmpty')
idValidator = ValidationChain('isValidId')
idValidator.appendSufficient('isEmptyNoError')
idValidator.appendRequired('isValidId')
TidyHTMLValidator = ValidationChain('isTidyHtmlChain')
TidyHTMLValidator = ValidationChain('isTidyHtmlChain')
TidyHTMLValidator.appendRequired('isTidyHtmlWithCleanup')
NotRequiredTidyHTMLValidator = ValidationChain('isTidyHtmlNotRequiredChain')
NotRequiredTidyHTMLValidator.appendSufficient('isEmptyNoError')
NotRequiredTidyHTMLValidator.appendRequired('isTidyHtmlWithCleanup')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_baseschema.py   Products.Archetypes(Download)
from Products.Archetypes.ExtensibleMetadata import FLOOR_DATE
from Products.Archetypes.ExtensibleMetadata import CEILING_DATE
from Products.validation import ValidationChain
 
from DateTime import DateTime
 
Dummy.schema = atapi.BaseSchema
 
EmptyValidator = ValidationChain('isEmpty')

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_baseschema.py   Products.Archetypes(Download)
from Products.Archetypes.ExtensibleMetadata import FLOOR_DATE
from Products.Archetypes.ExtensibleMetadata import CEILING_DATE
from Products.validation import ValidationChain
 
from DateTime import DateTime
 
Dummy.schema = atapi.BaseSchema
 
EmptyValidator = ValidationChain('isEmpty')