X-Git-Url: https://scm.cri.minesparis.psl.eu/git/Portfolio.git/blobdiff_plain/2da869b2b46179d64c05eaac4081226fdbbbc9ff..e73353500c67453ef9663d67eaeee7dd46c358ee:/migration/toV3.py?ds=sidebyside diff --git a/migration/toV3.py b/migration/toV3.py deleted file mode 100644 index 7e8eecc..0000000 --- a/migration/toV3.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################ -# Copyright © 2005-2008 Benoît PIN # -# Plinn - http://plinn.org # -# # -# This program is free software; you can redistribute it # -# and/or modify it under the terms of the Creative Commons # -# "Attribution-Noncommercial 2.0 Generic" # -# http://creativecommons.org/licenses/by-nc/2.0/ # -############################################################ - -from Products.Portfolio.container import Portfolio as NewPortfolio -from Products.Portfolio.photo import Photo as NewPhoto - -IGNORED_ATTRIBUTES = ('_randomCandidates', '_objects') - - -def migratePortfolio(old, container) : - print 'migrate %s' % old.absolute_url() - - origid = old.getId() - title = old.Title() - - new = NewPortfolio(origid, title=title) - - for name in old.__dict__.keys() : - if name in IGNORED_ATTRIBUTES : - continue - else : - setattr(new, name, getattr(old, name)) - - new._populateFromFolder(old) - - container._delOb(origid) - container._setOb(origid, new) - - return container._getOb(origid) - -def migratePhoto(old, container) : - print 'migrate %s' % old.absolute_url() - - origid = old.getId() - title = old.Title() - - new = NewPhoto.__new__(NewPhoto) - - for name in old.__dict__.keys() : - setattr(new, name, getattr(old, name)) - - container._delOb(origid) - container._setOb(origid, new) - - return container._getOb(origid)