Example #1
0
               primary=True,
               languageIndependent=True,
               storage = atapi.AnnotationStorage(migrate=True),
               swallowResizeExceptions = zconf.swallowImageResizeExceptions.enable,
               pil_quality = zconf.pil_config.quality,
               pil_resize_algo = zconf.pil_config.resize_algo,
               max_size = zconf.ATImage.max_image_dimension,
               sizes= {'large'   : (768, 768),
                       'preview' : (400, 400),
                       'mini'    : (200, 200),                   
                      },
               validators = (('isNonEmptyFile', V_REQUIRED),
                             ('checkImageMaxSize', V_REQUIRED)),
               widget = atapi.ImageWidget(
                        description = '',
                        label= _(u'image_attach_watermark', default=u'Image'),
                        show_content_type = False,)),

    ), marshall=atapi.PrimaryFieldMarshaller()
    )

# Title is pulled from the file name if we don't specify anything,
# so it's not strictly required, unlike in the rest of ATCT.
WatermarkImageSchema['title'].required = False




# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
Example #2
0
watermarkSchema = ATContentTypeSchema.copy() + atapi.Schema((
    atapi.ImageField('image',
               required=True,
               primary=True,
               languageIndependent=True,
               storage = atapi.AnnotationStorage(migrate=True),
               swallowResizeExceptions = zconf.swallowImageResizeExceptions.enable,
               pil_quality = zconf.pil_config.quality,
               pil_resize_algo = zconf.pil_config.resize_algo,
               max_size = zconf.ATImage.max_image_dimension,
               sizes ={},
               validators = (('isNonEmptyFile', V_REQUIRED),
                             ('checkImageMaxSize', V_REQUIRED)),
               widget = atapi.ImageWidget(
                        description = '',
                        label= _(u'watermark_image', default=u'Watermark Image'),
                        show_content_type = False,)),

    ), marshall=atapi.PrimaryFieldMarshaller()
    )

# -*- Message Factory Imported Here -*-

from my315ok.watermarkImage.interfaces import Iwatermark
from my315ok.watermarkImage.config import PROJECTNAME



# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.