X-Git-Url: https://scm.cri.minesparis.psl.eu/git/Photo.git/blobdiff_plain/a18ca54d896fa2f98cf2b7fb8955120ff5e0aa37..6c41809185e322ce2d30e98234f71144f78f06c0:/migration/toblob.py diff --git a/migration/toblob.py b/migration/toblob.py deleted file mode 100755 index e1fff2e..0000000 --- a/migration/toblob.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -""" -$Id: toblob.py 909 2009-04-20 13:38:47Z pin $ -$URL: http://svn.luxia.fr/svn/labo/projects/zope/Photo/trunk/migration/toblob.py $ -Script de migration du stockage du fichier depuis l'attribut 'data' -vers l'attribut de type blob 'bdata'. -IMPORTANT : -les lignes 144 à 147 de blobbases.py doivent être commentéés -avant exécution. - -147 | # data = property(_getLegacyData, _setLegacyData, -148 | # "Data Legacy attribute to ensure compatibility " -149 | # "with derived classes that access data by this way.") - -""" - -from ZODB.blob import Blob - -def migrate(self) : - if hasattr(self.aq_base, 'data') : - data = str(self.data) - self.bdata = Blob() - bf = self.bdata.open('w') - bf.write(data) - bf.close() - delattr(self, 'data') - return True - else : - assert hasattr(self.aq_base, 'bdata') - return False - \ No newline at end of file