[Zope-PTK] Multiple Inheritance and the Portal Base classes.

Steinar Rune Eriksen steinar@orion.no
Mon, 30 Oct 2000 13:41:07 +0100


Can anybody see why I get the following error ? I try to subclass
DemoPortalBase and PortalObjectBase into a class CMyPortalBase which I again
subclass with a Zope ZClass. 
It all works fine until I add another class in the inheritance list of
CMyPortalBase.When I try to call its __init__ method with the "self"
argument if does not recognise this as the instance variable ? (I tries to
print self, and it says that this is an instance of my ZClass).
In other Python programs, calling Parent.__init__(self) works fine, but when
running through Zope in this context

Error Type: TypeError
Error Value: unbound method must be called with class instance 1st argument


class CMyPortalBase(TemplatePage.CTemplatePage,Portal.DemoPortalBase,
PortalObject.PortalObjectBase):

    def __init__(self):
        TemplatePage.CTemplatePage.__init__(self)

The CTemplatePage class is as follows :

class CTemplatePage:

	standard_html_header = Globals.HTMLFile("StandardHeader", globals())
	standard_html_footer = Globals.HTMLFile("StandardFooter", globals())
	
	def __init__(self):
		print "In CTemplatePage"


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

Admin
Orion System AS
**********************************************************************