[Product-Developers] Making an adapter traversable

Hedley Roos hedleyroos at gmail.com
Tue Jul 15 21:45:25 UTC 2008

Hi all

I'm playing around with schemaextender and it is very useful. I'm
trying to make a method on my adapter traversable, so if I navigate to
http://server/my-adapted-object/foo I want method foo to execute.

I've got this method on the adapter

def foo(self):
  return "something"

My configure.zcml has
'provides="zope.traversing.interfaces.ITraversable"' in the adapter
registration. My class does implements(ISchemaExtender, ITraversable),
but it subclass only object and not Traversable.

I keep getting an Unauthorized error. Setting
__allow_access_to_unprotected_subobjects also does nothing.

What is the correct combination to get it working?


More information about the Product-Developers mailing list