(self, image)
Add a PersistentImage-type object to this PersistenImageManager
        This should only be called with an image that has not yet been added to the store.
        To retrieve a previously persisted image use image_with_id() or image_query()

        @param image TODO 

        @return TODO
Add a PersistentImage-type object to this PersistenImageManager
        This should only be called with an image that has not yet been added to the store.
        To retrieve a previously persisted image use image_with_id() or image_query()
Add a PersistentImage - type object to this PersistenImageManager This should only be called with an image that has not yet been added to the store . To retrieve a previously persisted image use image_with_id () or image_query ()
def add_image(self, image):
        """
        Add a PersistentImage-type object to this PersistenImageManager
        This should only be called with an image that has not yet been added to the store.
        To retrieve a previously persisted image use image_with_id() or image_query()

        @param image TODO 

        @return TODO
        """
        metadata = self.collection.find_one( { "_id": image.identifier } )
        if metadata:
            raise ImageFactoryException("Image %s already managed, use image_with_id() and save_image()" % (image.identifier))

        image.persistent_manager = self
        basename = self.storage_path + '/' + str(image.identifier)
        body_path = basename + BODY_EXT
        image.data = body_path
        try:
            if not os.path.isfile(body_path):
                open(body_path, 'w').close()
                self.log.debug('Created file %s' % body_path)
        except IOError as e:
            self.log.debug('Exception caught: %s' % e)

        self._save_image(image)
def add_image ( self , image ) : metadata = self . collection . find_one ( { "_id" : image . identifier } ) if metadata : raise ImageFactoryException ( "Image %s already managed, use image_with_id() and save_image()" % ( image . identifier ) ) image . persistent_manager = self basename = self . storage_path + '/' + str ( image . identifier ) body_path = basename + BODY_EXT image . data = body_path try : if not os . path . isfile ( body_path ) : open ( body_path , 'w' ) . close ( ) self . log . debug ( 'Created file %s' % body_path ) except IOError as e : self . log . debug ( 'Exception caught: %s' % e ) self . _save_image ( image )