[Zope] ZPT & passing around options...

Dieter Maurer dieter@handshake.de
Thu, 12 Sep 2002 23:01:26 +0200


Edward Muller writes:
 > ...
 > Because of my design, in a Python script I need to call something like:
 >   return container.content(variable1="sometxt", var2=["text1","text2"])
 > 
 > This ends up calling the local content, without the surrounding site
 > look'n'feel, <html> tags ... and the rest ... which is bad ...
Apparently, this case breaks your design principle ("content" does not
have arguments).

I see two options:

  *  extend your design principle: all "content" objects expect optional
     arguments.

     Inside your "index_html", you then have:

	    <div tal:content="structure python:apply(here.content,(),options)">

     and inside your script, you use

           return context.index_html(...)

  *  You use "REQUEST" to pass the special variables to "content"
     and let it look there for its arguments.


Dieter