[Zope] DTML Confusion?

Oleg Broytmann Oleg Broytmann <phd@phd.pp.ru>
Sat, 1 Sep 2001 10:46:28 +0400 (MSD)


On 31 Aug 2001 hamish@allan.tc wrote:
> JZ>I can also
> JZ>
> JZ><dtml-var "Util.utility_function(REQUEST=REQUEST)">
> JZ>
> JZ>but that is also a little long-winded.
>
> OB>DTML objects are really callable instances of classess. dtml-with calls
> OB>them automagically, but when you use dtml-var "..." these quotes move you
> OB>from DTML to Python, and in Python there is no automagical call - you must
> OB>call the objects yourself. There is no way to avoid it.
>
> but <dtml-var "Util.utility_function()">, which is a little less long-winded,
> should also work.

   Alas, no. When DTML automagically calls a DTML object, it passes current
namespace. If you call your objects from Python, you must pass namespace
yourself:

   <dtml-var "Util.utility_function(_.None, _)">

Oleg.
----
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.