[Zope] Typecasting in DTML (or is this Python?)
Chris Withers
chrisw@nipltd.com
Fri, 18 Jul 2003 15:50:18 +0100
Julian Clark wrote:
> Dylan,
>
> Thanks for your prompt reply.
> I'm only familiar with typecasting from my experience in Java (which isn't huge).
> it doesn't look like you're using the % as modulus in this context. Would you mind explaining a little of the syntax or pointing me
> towards a url which would have some tutorials/documentation.
http://www.python.org/doc/current/lib/typesseq-strings.html
> The fields which I am manipulating are driven by a form (actually, a series of forms) and so the data is a little dynamic
> - would this still be a suitable solution?
Yes
> The solution I had worked well until I changed the amount field in the database from text to numerical (so that other queries would
> operate correctly with it) at which point the history string lost its banana's because it was now dealing with a string and a float.
The % stuff will work fine with that.
You're still really abusing DTML though, please look at writing Python Scripts.
You'll find it much less frustrating and we'll be much mroe able to help you :-)
Chris