[Zope] Parametera and Formulator

Dieter Maurer dieter@handshake.de
Tue, 17 Sep 2002 20:54:44 +0200


Dag Nygren writes:
 > I have two questions today, both concerning the not so
 > clearly explained parameter passing of Zope:
There are few special things with parameter passing...

 > 1. Did  I understand it right when I assume that  all the
 >    variables (form and dtml-let stuff) are available in all the
 >    objects that are below  (in the object hierarchy) 
 >    the one where they were defined.
No.

You should probably read the "Name lookup" section of

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

Object hiearchy and "dtml-let" are orthogonal.
"REQUEST" (and its components like "form") are global in one request.

 > 2. How do I pass one of these Global (?) variables to  a python
 >    procedure from a DTML page ?
You use acquisition to access REQUEST, e.g. by "container.REQUEST".

You use acquisition to access attributes (properties and methods)
of objects, e.g. "context.some_parent.title".

You either pass dtml variables explicitely or bind the DTML
namespace (--> "Bindings tab"). Then use "_['your_dtml_variable']".


Dieter