[Zope] conversion in dtml-methods

Dieter Maurer dieter@handshake.de
Wed, 31 Jul 2002 23:28:43 +0200


Margrit Lottmann writes:
 > We have a formular with a checkbox... The result of
 > the checkbox is a list of strings.
 > 
 > In the following dtml-method (action) the method reads any string of the
 > list and has to initiate read instructions to a mysql database table
 > with this values but converted to integer...
 > 
 > 
 > zope error...value error
 >      invalid literal for int(): 17   ...17 was the string which has to be
 >                                            converted ???
Almost surely, your list elements contain whitespace.
This whitespace prevents them to be converted into integers.
Use the "strip" method of strings to discard the whitespace.


 > where is a good dtml documentation ...we have 2 books for zope, but the
 > dtml parts are not good...
You will not find an answer to the above problem in any DTML documentation,
as it is not a DTML problem at all.

I usually use the DTML documentation in the embedded Zope online help:

  Zope Help --> DTML
  Zope Help --> API Reference


Dieter