from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from vwcollective.simplecontact import simplecontactMessageFactory as _ from vwcollective.simplecontact.interfaces import ISimpleContact from vwcollective.simplecontact.config import PROJECTNAME SimpleContactSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( 'profession', storage=atapi.AnnotationStorage(), widget=atapi.StringWidget( label=_(u"Profession"), description=_(u"Enter profession or accademic title"), ), ), atapi.StringField( 'position', storage=atapi.AnnotationStorage(), widget=atapi.StringWidget( label=_(u"Position"), description=_(u"Enter position in the company"), ), ),
atapi.ImageField( 'image', storage=atapi.AnnotationStorage(), swallowResizeExceptions=True, max_size='no', sizes={'large' : (768, 768), 'preview': (400, 400), 'mini' : (200, 200), 'thumb' : (128, 128), 'tile' : (64, 64), 'icon' : (32, 32), 'listing': (16, 16), }, widget=atapi.ImageWidget( label=_(u"Preview Image"), description=_(u"Upload a preview image that will be shown in content listings"), ), validators=('isNonEmptyFile'), ), )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. SimpleContactFolderSchema['title'].storage = atapi.AnnotationStorage() SimpleContactFolderSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(