[Zope] formatting problem...

Phil Harris phil.harris@zope.co.uk
Thu, 15 Mar 2001 16:19:53 -0000


It sends them back as longs cos the MySQL int is bigger than Python int.

----- Original Message -----
From: "Paul Zwarts" <paul.zwarts@oratrix.com>
To: "Daniel Corr=EAa de Azevedo" <DANIELCA@senado.gov.br>
Cc: <zope@zope.org>
Sent: Thursday, March 15, 2001 4:12 PM
Subject: Re: [Zope] formatting problem...


> Hi Daniel,
>
> I have had similar problems with MySQL... What I use to get around it i=
s
to send
> it through the integer module. You'll find this also handy for converti=
ng
> strings that only contain numbers and dates to floats and yadda yadda..=
..:
>
> <dtml-var "_.int(varname)">
>
> Anyone got a better one? Or rather, explain why MySQL translates everth=
ing
as
> long integers? Is this ALWAYS the case when defining a dbase field as
INT4?
> Cheers,
> Paz
>
> Daniel Corr=EAa de Azevedo wrote:
>
> >     Hello you all.
> >     I=B4m having problem in using FMT atribute of the DTML-VAR tag in=
 dtml
> > methods. The situation is that when I receive some integer data from =
a
MYSQL
> > database, I get it with a L sufix. That makes it necessary to format =
the
> > data with <dtml-var key fmt=3D"%d">. Now, the problem is that, someti=
mes,
I
> > need to keep on passing the data over to a few dtml methods, and when
ever I
> > need to reformat the data, I get an erro message: " Ilegal argument t=
ype
for
> > built-in operation.".
> >    I need to reformat because the data in the other dtml-methods in t=
he
> > sequece may be being received from the MYSQL database.
> >    How coud I reformat the data using <dtml-var key FMT=3D"????">, ev=
en if
it
> > has already been formated by <dtml-var key fmt=3D"%d">?
> >
> >    Thanks,
> >                                                         Daniel C.
Azevedo
> >
> > _______________________________________________
> > 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 )
>
>
> _______________________________________________
> 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 )