[Zope-dev] Solved - Calling parent class method when method is overridden in current class?

Phil Harris phil.harris@zope.co.uk
Thu, 3 Aug 2000 12:29:13 +0100


Yay, Solved it!

I just had to call __call__ from the DTMLDocument and bob is now married to
my mothers sister.

Phil
phil.harris@zope.co.uk
----- Original Message -----
From: "Phil Harris" <phil.harris@zope.co.uk>
To: "Steve Alexander" <steve@cat-box.net>
Cc: "Zope-Dev@Zope. Org" <zope-dev@zope.org>
Sent: Thursday, August 03, 2000 9:45 AM
Subject: Re: [Zope-dev] Calling parent class method when method is
overridden in current class?


> Steve,
>
> I'm pretty sure I've tried that but I'll try it again and see what
happens,
> hang on I'll be right back.
>
> Right I'm back, I thought I'd tried it and I had, I get this error:
>
> Error Type: TypeError
> Error Value: call of non-function (type None)
>
> Traceback (innermost last):
>   File D:\ZOPE_2~1.2_D\lib\python\ZPublisher\Publish.py, line 222, in
> publish_module
>   File D:\ZOPE_2~1.2_D\lib\python\ZPublisher\Publish.py, line 187, in
> publish
>   File D:\ZOPE_2~1.2_D\lib\python\Zope\__init__.py, line 221, in
> zpublisher_exception_hook
>     (Object: 1_introd.xml)
>   File D:\ZOPE_2~1.2_D\lib\python\ZPublisher\Publish.py, line 171, in
> publish
>   File D:\ZOPE_2~1.2_D\lib\python\ZPublisher\mapply.py, line 160, in
mapply
>     (Object: index_html)
>   File D:\ZOPE_2~1.2_D\lib\python\ZPublisher\Publish.py, line 112, in
> call_object
>     (Object: index_html)
>   File D:\zope_2.2_dev\lib\python\Products\xmlRenderer\xmlRender.py, line
> 58, in index_html
>     (Object: 1_introd.xml)
> TypeError: (see above)
>
> which seems to be telling me that DTMLDocument.index_html is None, weird
eh!
>
> TFT (thanks for trying)
>
> Phil
> Phil.harris@zope.co.uk
>
>
> ----- Original Message -----
> From: "Steve Alexander" <steve@cat-box.net>
> To: "Phil Harris" <phil.harris@zope.co.uk>
> Cc: "Zope-Dev@Zope. Org" <zope-dev@zope.org>
> Sent: Thursday, August 03, 2000 9:40 AM
> Subject: Re: [Zope-dev] Calling parent class method when method is
> overridden in current class?
>
>
> > Phil Harris wrote:
> > >
> > > Hi all,
> > >
> > > I'm in the process of creating a Python based product, and have a need
> to
> > > call the base classes index_html method.
> > >
> > > My problem is that I need to call it from my classes index_html.
> > >
> > > My class has DTMLDocument as the base class so I want to call
something
> like
> > > DTMLDocument.index_html().
> >
> > Perhaps DTMLDocument.index_html(self) ?
> >
> > The only problem is if you need to call a base-class method from a
> > derived ZClass.
> >
> > --
> > Steve Alexander
> > Software Engineer
> > Cat-Box limited
> > http://www.cat-box.net
>
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )