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 ??? where is a good dtml documentation ...we have 2 books for zope, but the dtml parts are not good... MfG Margrit Lottmann +-----------------------------------------------------------------------+ | phone : +49 391 67 18572 | | +49 391 67 12819 | | Margrit Lottmann fax : +49 391 67 11134 | | | | Otto-von-Guericke-Universitaet Magdeburg | | Universitaetsrechenzentrum, URZ-N | | Universitaetsplatz 2 | | D-39106 Magdeburg, Germany | | | | Margrit.Lottmann@URZ.Uni-Magdeburg.DE | +-----------------------------------------------------------------------+
where is a good dtml documentation ...we have 2 books for zope, but the dtml parts are not good...
The Zope Bible is one of the better books in my mind: http://www.zopezen.org/Members/zopista/1012949789/view -- Andy McKay @gmweb Consulting http://www.agmweb.ca ----- Original Message ----- From: "Margrit Lottmann" <Margrit.Lottmann@URZ.Uni-Magdeburg.DE> To: <zope@zope.org> Sent: Tuesday, July 30, 2002 1:26 AM Subject: [Zope] conversion in dtml-methods
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 ???
where is a good dtml documentation ...we have 2 books for zope, but the dtml parts are not good...
MfG Margrit Lottmann
+-----------------------------------------------------------------------+
| phone : +49 391 67 18572 | | +49 391 67 12819 | | Margrit Lottmann fax : +49 391 67 11134 | | | | Otto-von-Guericke-Universitaet Magdeburg | | Universitaetsrechenzentrum, URZ-N | | Universitaetsplatz 2 | | D-39106 Magdeburg, Germany | | | | Margrit.Lottmann@URZ.Uni-Magdeburg.DE |
+-----------------------------------------------------------------------+
_______________________________________________ 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 )
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
participants (3)
-
Andy McKay -
Dieter Maurer -
Margrit Lottmann