[Zope] ZPT: examples in The Zope Book don't work

Joseph A. Knapka jknapka@earthlink.net
Tue, 27 Aug 2002 11:14:19 -0600


Hi folks,

I was trying page templates out for the first time the
other day, and ran into this minor problem:

After cut&pasting the code from the "compoundInterest"
example in chapter 5 of TZB into my ZMI, they didn't
work. The interestDisplay template, confronted with
<span tal:replace="years">, threw an exception claiming
that "years" was undefined. Changing it to
<span tal:replace="request/years"> worked fine.
Similarly, all references to request variables
in the invocation of the Python script had to be
changed from "variable" to "request.variable".

Am I missing something here, or is this the way
templates are supposed to work?

(Incidentally, this was Zope 2.5.1 on a Linux box.)

Thanks,

-- Joe
  "I'd rather chew my leg off than maintain Java code, which
   sucks, 'cause I have a lot of Java code to maintain and
   the leg surgery is starting to get expensive." - Me