[Zope] publishing a double-underscore method? - RESOLVED

Dylan Reinhardt zope@dylanreinhardt.com
06 May 2003 16:38:22 -0700


Thanks for the pointer, Paul... works like a charm!

For anyone else following this thread, the solution is:

---------

class Foo(various_mixins):
    def __bobo_traverse__(self, request, key):
        if key == 'test':
            return self.testing

    def testing(self):
        """ a test method """
        return 'testing, 1... 2... 3'

----------

This will return the results of foo.testing() for the request:

server/foo/test

Note that the absence of parens on line 4 is not a typo...
__bobo_traverse__ returns a callable object, not a result string.

Thanks again,

Dylan