(self)
Compatibility code to finalize migration from CMF Types Tool
Compatibility code to finalize migration from CMF Types Tool
Compatibility code to finalize migration from CMF Types Tool
def _finalizeMigration(self):
    """Compatibility code to finalize migration from CMF Types Tool"""
    portal = self.getPortalObject()
    old_types_tool = portal.__dict__[OldTypesTool.id]
    #self.Base_setDefaultSecurity()
    trash_tool = getattr(portal, 'portal_trash', None)
    if trash_tool is not None:
      LOG('OldTypesTool', WARNING, 'Move old portal_types into a trash bin.')
      portal._objects = tuple(i for i in portal._objects
                                if i['id'] != old_types_tool.id)
      portal._delOb(old_types_tool.id)
      #old_types_tool.id = self.id # Not possible to keep the original id
                                   # due to limitation of getToolByName
      trashbin = UnrestrictedMethod(trash_tool.newTrashBin)(self.id)
      trashbin._setOb(old_types_tool.id, old_types_tool)
def _finalizeMigration ( self ) : portal = self . getPortalObject ( ) old_types_tool = portal . __dict__ [ OldTypesTool . id ] #self.Base_setDefaultSecurity() trash_tool = getattr ( portal , 'portal_trash' , None ) if trash_tool is not None : LOG ( 'OldTypesTool' , WARNING , 'Move old portal_types into a trash bin.' ) portal . _objects = tuple ( i for i in portal . _objects if i [ 'id' ] != old_types_tool . id ) portal . _delOb ( old_types_tool . id ) #old_types_tool.id = self.id # Not possible to keep the original id # due to limitation of getToolByName trashbin = UnrestrictedMethod ( trash_tool . newTrashBin ) ( self . id ) trashbin . _setOb ( old_types_tool . id , old_types_tool )