[Zope] object id's and request vars

Dieter Maurer dieter@handshake.de
Thu, 16 Jan 2003 22:07:34 +0100


Lieven Van Acker wrote at 2003-1-16 11:28 +0100:
 > Hi,
 > 
 > I need to include a fragment identified by a request var in a PT . This
 > is something I tried. I believe there must be an easier way to achieve
 > this. 
 > 
 >     <SPAN tal:condition="exists:request/form/var"
 >        tal:repeat="x python:here.objectItems()"> 
 >       <P tal:condition="python:x[0]==request.form['var']"
 >          tal:define="y python:x[1]"
 >          tal:replace="structure y">
  <p  tal:define="var request/form/var"
      tal:replace="structure here/aq_explicit/?var" />
comes quite near.

The weak point is the "aq_explicit" which often (but not always)
prevents acquisition.
When you want to be safe, you need to search the collector
for "hasattr_unacquired".


Dieter