All pastes #469580 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-03 20:19 UTC
rendered paste body
ATVideoSchema = ATFileSchema.copy() + Schema((

    FileField('file',
                primary=1,
                required=1,
                languageIndependent=1,
                validators=MaxSizeValidator("checkFileMaxSize", maxsize=MAX_FILE_SIZE),
                storage=ExternalStorage(prefix=FS_DIRECTORY, archive=False, rename=False),
                widget=FileWidget(label="Video File",
                                    label_msgid="label_videofile_file",
                                    description="Upload your video file.",
                                    description_msgid="desc_videofile_file",
                                    i18n_domain="ATVideo")
                ),

    StringField('title',
                searchable=1,
                required=True,
                languageIndependent=1,
                widget=StringWidget(label="Title",
                                    label_msgid="label_videofile_title",
                                    description="The title of this video file.",
                                    description_msgid="desc_videofile_title",
                                    i18n_domain="ATVideo"),
                ),

    IntegerField('year',
                searchable=1,
                languageIndependent=1,
                validators=('isInt',),
                widget=IntegerWidget(label="Year",
                                     label_msgid="label_videofile_year",
                                     description="Enter the year that this video file was recorded.",
                                     description_msgid="desc_videofile_year",
                                     i18n_domain="ATVideo",
                                     size="4",
                                     ),
                ),

    StringField('genre',
                searchable=1,
                languageIndependent=1,
                widget=SelectionWidget(label="Genre",
                                     label_msgid="label_videofile_genre",
                                     description="Enter the genre that this video file was recorded.",
                                     description_msgid="desc_videofile_genre",
                                     i18n_domain="ATVideo",
                                     ),
                vocabulary='getGenres',
                ),

    TextField('comment',
                searchable=1,
                languageIndependent=1,
                widget=TextAreaWidget(label="Comment",
                                     label_msgid="label_videofile_comment",
                                     description="Enter a comment about this video file.",
                                     description_msgid="desc_videofile_comment",
                                     i18n_domain="ATVideo",
                                     ),
                ),


    ImageField('poster',
               required = 0,
               languageIndependent=1,
               original_size = (600,600),
	        sizes={ 'mini' : (80,80),
		'normal' : (200,200),
		'big' : (300,300),
		'maxi' : (500,500)},
               widget = ImageWidget(label= "CD cover image",
                                    label_msgid = "label_cd_coverimage",
                                    description = "Upload a CD cover image. It will be automatically resized",
                                    description_msgid = "desc_cd_coverimage",
                                    i18n_domain = "ataudio")
               ),
    ),
    marshall=PrimaryFieldMarshaller(),
   )