Back to index

plone3  3.1.7
SimpleFile.py
Go to the documentation of this file.
00001 from Products.Archetypes.atapi import *
00002 from Products.Archetypes.Marshall import PrimaryFieldMarshaller
00003 from Products.Archetypes.config import PKG_NAME
00004 
00005 schema = BaseSchema + Schema((
00006     FileField('body',
00007               required=1,
00008               primary=1,
00009               widget=FileWidget(),
00010               ),
00011     ),
00012       marshall=PrimaryFieldMarshaller())
00013 
00014 class SimpleFile(BaseContent):
00015     """An File (test) type"""
00016     schema = schema
00017     archetype_name = "Simple File Type"
00018     
00019     def manage_afterPUT(self, data, marshall_data, file, context, mimetype,
00020                         filename, REQUEST, RESPONSE):
00021         """For unit tests
00022         """
00023         self.called_afterPUT_hook = True
00024 
00025 registerType(SimpleFile, PKG_NAME)