[Zope] VERY Confused!

Ben Ocean zope@thewebsons.com
Tue, 23 Oct 2001 12:39:59 -0700


At 09:08 PM 10/23/01 +0100, you wrote:
>* Ben Ocean <zope@thewebsons.com> [011023 19:49]:
> > Hi;
> > I'm new to Python and Zope, but I'm at a loss to understand WHY this
> > doesn't work! I have this line in my dtml code:
> > <span class="top"><img src="images/top" width=<dtml-var
> > "sizeCalc(1008,size)"> height=<dtml-var "sizeCalc(82,size)">></span>
> > *size* is a dtml method and is defined thus:
> > 1
> > just the number one.
>
><snip>
>
> > Error Type: TypeError
> > Error Value: int() can't convert non-string with explicit base
>
>The 'size' argument in
>
>   <dtml-var "sizeCalc(1008, size)">
>
>is a string; the first argument is an int.

Hmm. Tested *both* variables using type and *both* returned string.

Paul Winkler writes:
 > try this:
 > x = int(x)
 > y = int(y)

I forgot to post that I *had* tried that. This is the error:
Error Type: AttributeError
Error Value: __int__

I'm even more confused than before and concerned that there might be 
something wrong with my installation at this point. I *do* have functioning 
sites in Zope, however.

Here is the current code for sizeCalc()
import string

def sizeCalc(x,y):
# x = string.atoi(x)
# y = string.atoi(y)
  x = int(x)
  y = int(y)
  return (x*y)


TIA,
BenO