[Zope] object overloading

Eli Thorkelson blue_eli@yahoo.com
Wed, 10 Oct 2001 13:17:52 -0700 (PDT)


I'm having trouble with the following case. It seems
like it should be really easy, but I don't know how to
make it work:

I have the following objects:
a_method()
folder1/a_method()
folder1/whatever/whatever

The problem is this:
a_method(), in the root folder, gets used all over my
site. It's called from various subfolders of folder1
(that is, folder1/whatever/whatever calls a_method()).
But now I now need a_method() to do something a little
different -- *only* when it's called within folder1.
So here's the problem:
folder1/whatever/whatever needs to call a_method()
<dtml-var a_method()>
and have that refer to /folder1/a_method().
It's no problem getting THAT far.
But then, /folder1/a_method() needs to call
/a_method(). This is what I can't figure out. Part of
the problem is that /a_method() _needs_ to have the
context of /folder1/whatever/whatever, to work.

I would like to write (inside /folder1/a_method()):
<dtml-var "folder1.getParentNode().a_method()">

but unfortunately it doesn't work. I get a NameError
on 'folder1.' The NameError only occurs when I try to
use folder1.getParentNode.a_method(). If I just write
"folder1.title_or_id()", for instance, it works fine.

So... can anyone help me find out how to overload
method names and still call the methods (in the
original context) that are higher up in the object
hierarchy?

--Eli

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com