[PEAK] sitemaps: <content> in non-root <location>
Phillip J. Eby
pje at telecommunity.com
Fri Jan 7 13:12:25 EST 2005
At 06:50 PM 1/7/05 +0100, Radek Kanovsky wrote:
>On Fri, Jan 07, 2005 at 11:38:48AM -0500, Phillip J. Eby wrote:
> > If the helper wants to add names, it can do so directly, it doesn't
> need to
> > offer them as views. I don't see much use for it being a view service.
>I am not sure if you understand me wholly. When you use helper for some
>view in non-root location, this non-root location is not in context
>stack. There is cloned context for helper in the stack instead of
>context for non-root location.
Sorry, I misunderstood you.
>So sitemaps.addHelper should be fixed
> def addHelper(handler,helper):
> def helped_handler(ctx, ob, namespace, name, qname,
> ob = helper(ob)
> return handler(
> ctx.clone(current=ob, viewHandler=ctx.viewHandler),
> return helped_handler
Right; I see what you mean. I'm wondering if maybe I should just add
'viewHandler' to the list of attributes that are automatically cloned. But
I'm not sure if there are maybe clonings that change 'current', but where
the viewHandler should *not* be kept. I'll have to take a look at that.
More information about the PEAK