[ZODB-Dev] Migrating classes in ZODB 3.5.1

David Binger dbinger at mems-exchange.org
Thu Nov 10 06:04:07 EST 2005


On Nov 10, 2005, at 4:30 AM, Lennart Regebro wrote:

> This may not help, but anyway. :)
>
>  In Zope, I did this: I moved the class to the module I wanted it. I
> also kept a "dummy class" in the old place like so:
>
> from newplace import class
>
> so that the old objects worked. Then I wrote a script to go through
> the ZODB and recreate every object. I then could remove the dummy
> import.

The good thing about this method is you don't need to hack up
sys.modules (or do classfactory tricks) at all.  By re-pickling every
object you can be sure that every instance containing a reference to
an instance of the moved class is repaired.




More information about the ZODB-Dev mailing list