Logo Search packages:      
Sourcecode: zope-photo version File versions

def zope-photo-1.2.3::PhotoFolder::PhotoFolder::PUT_factory (   self,
  name,
  typ,
  body 
)

Create Photo objects by default for image types.

Definition at line 307 of file PhotoFolder.py.

00307                                           :
        """Create Photo objects by default for image types."""
        if typ[:6] == 'image/':
            store = self.propertysheets.get('photoconf').getProperty('store')
            photo = Photo(name, '', '', store=store)

            # Init properties with defaults
            props = self.propertysheets.get('photos')
            for propid, value in props.propertyItems():
                try: photo.manage_addProperty(propid, value, props.getPropertyType(propid))
                except: pass

            # Init settings with defaults
            photoconf = self.propertysheets.get('photoconf')
            settings = {}
            for propid, value in photoconf.propertyItems():
                settings[propid] = value
            photo.propertysheets.get('photoconf').manage_changeProperties(settings)

            # Init displays with defaults
            photo._displays = self._displays.copy()
            return photo

        return None

#
# Factory methods
#

manage_addPhotoFolderForm = DTMLFile('dtml/addPhotoFolderForm', globals())


Generated by  Doxygen 1.6.0   Back to index