[z3-five] Templates in views and path expressions

Martin Aspeli optilude at gmx.net
Mon May 7 17:30:34 CEST 2007


Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Martin Aspeli wrote:
>> Tres Seaver wrote:
>>
>>>>>>   - The <require /> directive doesn't seem to work properly on simple 
>>>>>> properties
>>>>> Your context object somehow has no acquisition wrapper, and therefore
>>>>> cannot be verified by Zope's acquisition-based security policy.
>>>> Strange; it derives from CMF's PortalFolder (and a few other things), so 
>>>> it should be acquisition-aware, and I'm invoking the view via normal 
>>>> traversal.
>>>>
>>>> What is telling you that there's no aq wrapper, specifically?
>>> The check for 'aq_inContextOf' is failing;  that method is defined in C
>>> for acquisition wrappers.  Could you be running into a case where the
>>> context is actually tuple-ified to prevent wrapping it in the view?  I
>>> think that is an AT thing, but don't recall for sure.
>> I don't think that has anything to do with AT, and in any case, my 
>> product doesn't use Archetypes.
>>
>> I put this in the template:
>>
>> <b tal:content="python:context.aq_chain" />
>>
>> It outputs:
>>
>> [<Project at /test/my-workspace>, <PloneSite at /test>, <Application at
>>  >, <ZPublisher.BaseRequest.RequestContainer object at 0x82945b0>]
> 
> Try this:
> 
>   <b tal:content="python:context.aq_inner.aq_chain" />
> 
> For security purposes, only the "innermost" wrappers (the "true
> containment") matter.

This gives the same result. Bear in mind that I'm only traversing to 
this object "as normal" - I don't see much scope for it to be wrapped in 
something else.

Martin



More information about the z3-five mailing list