[CPS-devel] transtyping documents to folderish documents

Jean-Marc Orliaguet jmo at ita.chalmers.se
Thu Jun 1 18:28:22 CEST 2006


Hi!

I'm about to migrate a couple of documents from "documentish" to 
folderish (FolderishProxyDocument)

CPS uses isinstance(ProxyFolderishDocument) in some places, so changing 
to portal type to folderish is not enough.

instances must be changed too.

the current script does:

     for brain in brains:
        ob = brain.getObject()
        if ob is None:
            continue

        if isinstance(ob, ProxyFolderishDocument):
            continue

        ob.__class__ = ProxyFolderishDocument
        ob._p_changed = 1 # trigger persistence
        ob.proxyChanged()

        # + some workflow history stuff omitted here

anything more to think about ?

/JM


More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.