[Zope] DTML namespace puzzle

Ron Bickers rbickers@logicetc.com
Fri, 26 Jan 2001 20:24:22 -0500


Just when I thought I was catching on to everything, I ran into this.

I'm using Zope 2.3.0 (final).  I don't know if this worked the same with 2.2
because I didn't try this until today.  SQLSession is handling the SESSION
stuff, and I haven't had any problems with it.

I have a Python Script (sendOrder) that calls a DTML method (orderMessage)
as follows:

  container.orderMessage(num=num, SESSION=SESSION)

orderMessage contains the following:

  <dtml-with "SESSION['info']" mapping>
  Order Number: <dtml-var num>
  Blah blah other session variables that work fine.
  </dtml-with>

I get a KeyError on num.  If I modify orderMessage to contain the following,
it works:

  <dtml-let num=num>
  <dtml-with "SESSION['info']" mapping>
  Order Number: <dtml-var num>
  Blah blah other session variables that work fine.
  </dtml-with>
  </dtml-let>

This seems strange to me.  What am I missing?

_______________________

Ron Bickers
Logic Etc, Inc.
rbickers@logicetc.com