[Zope] Class - Object relationship

Lennart Regebro lennart@regebro.nu
Sun, 9 Dec 2001 10:22:01 +0100


From: "Tom Cameron" <tom@cameron.to>
> Is there anyway to query what class an object is instanced off? And also
to
> edit this i.e. in the event that the class may have been renamed.

No need to do that really. I moved a class from one file to another for
clarity.
The result was of course that all the instances broke...
So I then created a dummy class in the old file:

from Newfile import theClass

class theClass(theClass):
    pass

Now you have a class with the old name, that does exactly what the class
with the new name does.
If you want to get rid of the old objects, you could make a pythonscript
that goes through the whole database and deletes the old objects and creates
new ones with the same data.