[Zope] publishing a double-underscore method?

Dylan Reinhardt zope@dylanreinhardt.com
06 May 2003 16:21:49 -0700


On Tue, 2003-05-06 at 11:45, Paul Winkler wrote:
> >     if name == 'test':
> >         return 'this is a test'
> 
> so you're visiting http://mysite/foo/test?

Yes.

> i guess the problem is that 'test' and/or 'this is a test'
> do not have docstrings. i'm not sure which is the problem.

I'm not sure I see how either *could* have docstrings.  Am I missing
something?

> 
> try using some type other than strings, something with a docstring?

I also did:

__getattr__(self, name):
    if name == 'test':
        return self.my_test()

*and* tried

__getattr__(self, name):
    if name == 'test':
        return self.my_test().__of__(self)

for:

def my_test(self):
    """ got a docstring here too """
    return 'simple test completed'

Each of the above uses of my_test returned the same docstring error.

> 
> anyway, all that said, i think you might consider using
> __bobo_traverse__ instead of __getattr__. That's what it's for.

Sounds like I've got some Googling to do.  Thanks for the push in the
right direction.

Dylan