[Zope] Adding a base class to a Z Class

douwe@oberon.nl douwe@oberon.nl
Mon, 24 Jun 2002 19:17:47 +0200

>  > ZDerived1, I get unchanged results. Somewhere a copy of the
> old ZBase seems
>  > to lurk around. How can that be?
> Did you restart your Zope?

Yes I did restart Zope, but to no avail.

So I decided to dig a little deeper. I exported my base class and one
depending class in seperate .zexp files. I set up a new zope server, created
a new product and imported the classes. I then deleted all methods from both
classes, except one in the base. I modified this method to only return a
fixed string. I then added a index_html method to the depending class that
would only call the one remaining function in the base class.

I created an instance of the depending class and tried to run index_html,
but it gave an error, in the method of the base class, but alas on a line
that no longer existed. To prove myself a point, I created a new depending
class, directly derived from the base class and added the same index_html.
Instances of this one do work.

Very weird. I then exported the whole thing using xml, just to see if I
could find something. Opening the xml reveiled the complete implementation
of the base class, including all the methods I deleted. The method I left in
the base class turned up twice, once in its new incarnation, once in its old
incarnation. I did pack the database before export.

I have now two simple zclasses which look completely identical, but give
different results. Any clue as to what might go wrong and why deleted code
shows up in an export?