traductions++
[Plinn.git] / Products / Plinn / migration / folder.py
1 from Products.Plinn.HugePlinnFolder import HugePlinnFolder
2
3 IGNORED_ATTRIBUTES = ('_objects',)
4
5 def migrateFolder(old, container) :
6 print 'migrate %s' % old.absolute_url()
7
8 origid = old.getId()
9 title = old.Title()
10 toBeSkipped = IGNORED_ATTRIBUTES + tuple(old.objectIds())
11
12 new = HugePlinnFolder(origid, title=title)
13
14 for name in old.__dict__.keys() :
15 if name in toBeSkipped :
16 continue
17 else :
18 setattr(new, name, getattr(old, name))
19
20 new._populateFromFolder(old)
21
22 container._delOb(origid)
23 container._setOb(origid, new)
24
25 return container._getOb(origid)