All pastes #237924 Raw Edit

Untitled

public text v1 · immutable
·published 2006-11-04 20:11 UTC
rendered paste body
from Products.Archetypes.public import Schema
from Products.ATContentTypes.content.image import ATImageSchema, ATImage
from Products.Archetypes.public import StringField, StringWidget
from Products.Archetypes.public import registerType
 
schema = ATImageSchema + Schema((
    StringField('photographer',
                widget=StringWidget(
                    label='Fotograf',
                    description='insert the photographer's name'
                )
    ),
))
schema.moveField('photographer', after='description')
 
class Photo(ATImage):
    """ Photo content type similar to ATImage but with added
        "Photographer" field. """
    schema = schema
    archetype_name = 'Photo'

registerType(Photo, 'Photo')