[Zope] Sub Class Question
Loren Stafford
lstaffor@dynalogic.com
Sat, 26 Aug 2000 10:29:37 -0700
I'm not sure if this is the same situation I encountered in Xron's
XronDTMLMethod.py, where I'm overriding CatalogAware's index_object method.
# Only index if nextEventTime returns something
def index_object(self):
if self.nextEventTime() is not None:
CatalogAware.index_object.im_func(self)
# see Python Reference Manual "The standard type hierarchy"
# for the built-in type im_func
-- HTH
-- Loren
----- Original Message -----
From: "Daniel Rusch" <drusch@globalcrossing.com>
To: <zope@zope.org>
Sent: August 25, 2000 02:51 PM
Subject: [Zope] Sub Class Question
> I've created a BasicMethod which is derived from the DTMLMethod.
> everything works great until I try to have the sub class's
> (BasicMethod) __call__ method call the super class's (DTMLMethod)
> __call__ method.
>
> class BasicMethod(DTMLMethod):
> """BasicMethod objects are DocumentTemplate.HTML objects that act
> as methods whose 'self' is the BasicMethod itself."""
>
> meta_type='Basic Method'
>
>
> def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
> print 'Sub Class __call__'
> DTMLMethod.__call__(self, client, REQUEST, RESPONSE, kw)
>
> Globals.default__class_init__(BasicMethod)
>
>
> when I view the BasicMethod in Zope, I get:
> Error Type: TypeError
> Error Value: too many arguments; expected 4, got 5
>
>
> I believe that I need the self arg, if I remove it I get an unbound
> python method error.
>
> Any thoughts???
>
> DR
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>