Here is the complete solution: <html> <body> <p>Your total balance (or debt) including compounded interest over <span tal:content="request/years">2</span> years is:</p> <span tal:define="principal request/principal; interest_rate request/interest_rate; periods request/periods; years request/years"> <p><b>$<span tal:content="python: here.calculateCompoundingInterest( principal, interest_rate, periods, years)"> 1.00 </span> </b> </p> </span> </body> </html> -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Simon Forster Sent: Thursday, June 05, 2003 9:05 AM To: Sylvain Thénault Cc: zope@zope.org Subject: Re: [Zope] Zope Book -> Chap 3 -> Interest Rate Example On Thursday, June 5, 2003, at 01:51 pm, Sylvain Thénault wrote:
<span tal:content="request/form/years">2</span>
Thank you for that. That fixes one problem but then: $<span tal:content="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="python: 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="python: 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 ___________________________________________________ _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.486 / Virus Database: 284 - Release Date: 5/29/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.486 / Virus Database: 284 - Release Date: 5/29/2003