[Zope] classmethod() and zope?

Jürgen Herrmann Juergen.Herrmann at XLhost.de
Mon Feb 28 09:38:27 EST 2005


hi!

i have the following method defined in an extension class:
    def reInitClass(cls):
        """ docstring """
        cls().reInit()
    reInitClass = classmethod(reInitClass)

as one can see this method should call the parameter named "cls" and
this way make an instance of cls and then call reInit() on this
instance...


i'd like to call this method in the __init__.py file of my product:
def initialize(registrar):
    registrar.ViewContainer(
            ViewContainer,
            constructors = (addViewContainerForm, addViewContainerMethod)
        )
    ViewContainer.reInitClass()


starting zope with these files in place yields the following error
message:
  File "/home/apis/zope-bliss01/Products/ViewContainer/__init__.py", line
10, in initialize
    ViewContainer.reInitClass()
TypeError: 'classmethod' object is not callable

wtf??? if a classmethod object is not callable, what is it for then?
a simple python example with classmethod() did work of course - so
am i trying something impossible in zope?

thanks in advance for your replies...

regards, juergen herrmann


More information about the Zope mailing list