[Zope] DTML Example In Zope Book

Lloyd Kvam lloyd@venix.com
Thu, 01 Mar 2001 15:40:48 -0500


You might want to post the two snippets of code for review.  If the names match
between
the two dtml code snippets, then things should work.  Something probably went
wrong
with the process used to duplicate the Zope Book code.

Dave wrote:
> 
>         As a Zope newbie, I attempted to run the little DTML Method example in the
> Zope book (Chap 3 - Basic Objects). This involves creating 2 DTML Methods
> and a Python script to input some numbers and return compounding interest data.
> 
>         I basically copy-pasted the code from the book into the needed methods and
> script, but when I run it, I continually get a NameError (Zope cannot find
> a var with this name) on the first variable that the script comes to when
> running.
> 
>         For example, if I access the page as in the example, I get a NameError on
> "interest_rate". If I remove this from the picture (remove the
> "interest_rate" reference from the calculateCompoundingInterest script and
> then access the form again, I will get a NameError on the next variable it
> runs into  - this time "periods."
> 
>         I have some familiarity with Perl, but have not used Python scripting, so
> I have no idea where to start on troubleshooting this. But it appears to
> not be a script problem, but rather that the variable assignments made in
> the form thru the first DTML Method are not being passed to the script.
> 
>         Is there a syntax change that needs to be made for a newer Zope? As I
> said, I basically copy and pasted the code from the example since I am just
> beginning to learn the DTML calls. I have Zope 2.3.0 installed on a Win32
> platform.
> 
>         Thanks for any assistance!!
> 
>         - Dave
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-443-6155
fax:	801-459-9582