
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 )
|