Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

2009-05-20 Thread Martin Aspeli
Jan Hackel wrote: > Some days ago I ran into the same problem, and have been pointed to this > thread. Maybe you are interested in my solution. It's ugly, but I needed it > for a test-case, where I wanted to access > "@@plone_context_state/is_view_template": > > >>> from ZPublisher.HTTPRequ

Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

2009-05-19 Thread Jan Hackel
Some days ago I ran into the same problem, and have been pointed to this thread. Maybe you are interested in my solution. It's ugly, but I needed it for a test-case, where I wanted to access "@@plone_context_state/is_view_template": >>> from ZPublisher.HTTPRequest import HTTPRequest >>>

Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

2009-05-15 Thread Paul Winkler
On Thu, May 14, 2009 at 10:55:40PM +0200, Laurence Rowe wrote: > > For maximum portability across Z2 / Z3 / BFG, you could just do the same > > thing and implement __getitem__ on any object you want to be traversable > > by either the publisher or APIs like (un)restrictedTraverse, and forego > > th

Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

2009-05-14 Thread Laurence Rowe
Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Martin Aspeli wrote: > >> There's currently a funny inconsistency in Zope's Traversable class. If >> you have a URL like http://localhost:8080/path/to/@@aview/foo, and >> @@aview implements IPublishTraverse (and, I presume

Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

2009-05-14 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Aspeli wrote: > There's currently a funny inconsistency in Zope's Traversable class. If > you have a URL like http://localhost:8080/path/to/@@aview/foo, and > @@aview implements IPublishTraverse (and, I presume, if there's a custom > IPublis