def __instance_to_metadata__(self):
        """ parse self self.metadata """   
        image = {}
        image['filename'] = self.filename 
        for key, default in vars(self.__class__).items():
            if not key.startswith('_') and key !='' and (not key in vars(Blob).items()):                                      
                if isinstance(default, datetime.date):
                    image[key] = safe_cast(getattr(self, key, default), str, dformat=self._dateformat)
                if isinstance(default, datetime.datetime):
                    image[key] = safe_cast(getattr(self, key, default), str, dformat=self._datetimeformat)
                else:
                    image[key] = getattr(self, key, default)
               
        self.metadata = image
def __instance_to_metadata__ ( self ) : image = { } image [ 'filename' ] = self . filename for key , default in vars ( self . __class__ ) . items ( ) : if not key . startswith ( '_' ) and key != '' and ( not key in vars ( Blob ) . items ( ) ) : if isinstance ( default , datetime . date ) : image [ key ] = safe_cast ( getattr ( self , key , default ) , str , dformat = self . _dateformat ) if isinstance ( default , datetime . datetime ) : image [ key ] = safe_cast ( getattr ( self , key , default ) , str , dformat = self . _datetimeformat ) else : image [ key ] = getattr ( self , key , default ) self . metadata = image
parse self self.metadata