Martin Aspeli wrote:
> Hi Tim,
> 
> This is what IPublishTraverse is for.

Yes and know, if I understand things correctly.  I am already using
custom traversal in order to allow URLs like
"http://example.com/weblog/2007/06/01/blog_post"; to work (Although the
code that does this is a bit dated, and doesn't used IPublishTraverse, I
think
<http://dev.plone.org/collective/browser/Quills/branches/maurits-traversal/traversal.py?rev=42943>.)

What I'm trying to do now is make it so that methods on my weblog object
will return lists of IWeblogEntry-ish objects that know what sort of URL
they should have.  That way, I can call IWeblog.getLazyEntries(), which
does a catalog search for appropriate IWeblogEntry objects, and then
call absolute_url (or getURL) on each of the returned objects and have
it return a blog-archive-ish URL rather than where it really lives.  If
I understand correctly, this latter case has nothing to do with
IPublishTraverse, hence my desire to wrap/proxy the brains/objects with
something that will give my the correct URL behaviour, and then just
pass everything else through to the underlying object.  My attempt at
implementing this is at
<http://dev.plone.org/collective/browser/Quills/branches/maurits-traversal/traversalfaker.py?rev=42942>.

Does this approach make sense?  If so, how can I get restrictedTraverse
to call my proxy's absolute_url method rather than the underlying one?
(At least, I think it's restrictedTraverse that's not doing what I want...)


Cheers,


Tim

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to