[Zope] Aquisition
Dieter Maurer
dieter@handshake.de
Fri, 14 Feb 2003 20:11:33 +0100
Hi Volker,
Volker Wend wrote at 2003-2-13 22:27 +0100:
> I am developing an Page Template that should create a link depending on the content of that folder. If I find an index_html, I want a Link otherwise not.
>
> I have a Python Script check4index_html:
>
> return hasattr(context.aq_explicit,'index_html')
>
> and the following PageTemplate:
>
> <a tal:condition="python:r.object.check4index_html()==1" tal:content="r/object/title_or_id" tal:attributes="href url" target="main">Id</a>
>
> For some reasons the condition evaluates to true all the time. The script works fine and the objects are valid ( I see the right title).
>
> So what is wrong ?
Almost surely, its the "aq_explicit". It can only restrict
acquisition but not prevent it completely.
Because of this, I put a feature request (with patch)
into Zope's collector (<http://collector.zope.org/Zope>).
Search for "hasattr_unacquired").
I really hope it will find its way into Zope 2.7 and
we get rid of the unreliable "aq_explicit" hack.
Maybe, Chris Withers can help with this.
I know, you will be able to apply the patch yourself
(until it is in an official Zope distribution).
Dieter