Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev
Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?
 

Index | Next | Previous | View Flat


optilude+lists at gmail

May 14, 2009, 8:14 AM


Views: 546
Permalink
Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?

Hi,

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
IPublishTraverse adapter for any other path component), URL traversal
will work fine, but calling to.restrictedTraverse('@@aview/foo') or some
variant thereof will fail, because (un)restrictedTraverse() does not
respect custom IPublishTraverse adapters.

I can kind of see why it's done like this since it's called
I*Publish*Traverse, but it is a pain.

Note that namespace traversal (like ++skin++) works fine with
restrictedTraverse().

I don't think it'd be hard to implement this, but:

- is this a bug?
- is there a reason not to do this?

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Subject User Time
Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? optilude+lists at gmail May 14, 2009, 8:14 AM
    Re: Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? tseaver at palladion May 14, 2009, 9:55 AM
        Re: Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? l at lrowe May 14, 2009, 1:55 PM
            Re: Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? slinkp at gmail May 15, 2009, 12:28 PM
    Re: Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? plonecode at hackel May 17, 2009, 1:32 PM
        Re: Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters? optilude+lists at gmail May 20, 2009, 3:35 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.