[Zope] Adding a base class to a Z Class

douwe@oberon.nl douwe@oberon.nl
Fri, 21 Jun 2002 17:44:50 +0200


Hi,

I have a Z Class which itself is a base, let's name it ZBase for a number of
other classes, say ZDerived1..ZDerivedN. Now I want to add another base
class to ZBase, but I don't much fancy rebuilding ZDerived1..ZDerivedN, let
alone recreating all instances of the ZDerived family.

I found a few articles about this and they all sugest creating a new ZBase,
but one with the same Class ID and the same Metatype. In order to avoid all
interferance, I created the new ZBase class with the new derivation, added
all methods to it, gave it the right Class ID and meta type and exported it
to a ZBase.zexp file.

Then I went back to the working version of my application with the old
ZBase. I deleted the old ZBase, imported the new one and restarted. As luck
would have it, things were still working great.

Except that ever since, all changes to the new ZBase are ignored. If I
change a method in ZBase and call that method using an instance of
ZDerived1, I get unchanged results. Somewhere a copy of the old ZBase seems
to lurk around. How can that be?

I suspect that there are compiled versions of my python code in the ZODB and
that for some reason the link to the source has been broken, so that the
code is not recompiled or something similar. Any clue what I can do?

Douwe