[Zope] Zope Book -> Chap 3 -> Interest Rate Example

Simon Forster simon-lists@ldml.com
Thu, 5 Jun 2003 14:05:15 +0100


On Thursday, June 5, 2003, at 01:51  pm, Sylvain Th=E9nault wrote:

> <span tal:content=3D"request/form/years">2</span>

Thank you for that. That fixes one problem but then:

$<span tal:content=3D"python: =
here.calculateCompoundingInterest(principal,
interest_rate,
periods,
years)" >1.00</span>

fails (as I would expect given your posting) but so does

<span tal:content=3D"python:=20
here.calculateCompoundingInterest(request/form/principal,
request/form/interest_rate,
request/form/periods,
request/form/years)" >1.00</span>

with error:

Error Type: NameError
Error Value: global name 'form' is not defined

while

<span tal:content=3D"python:=20
here.calculateCompoundingInterest(request/principal,
request/interest_rate,
request/periods,
request/years)" >1.00</span>

fails with error

Error Type: NameError
Error Value: global name 'principal' is not defined

Why?

Simon Forster
___________________________________________________
   LDML Ltd, Office One, 16 Canham Road, London, W3 7SR, UK
         Tel: +44 (0)20 8749 7766     Fax: +44 (0)70 9230 5247
___________________________________________________