[Zope] Database Datatypes

Wade Pearce Wade.Pearce at dpac.tas.gov.au
Sun Dec 21 17:22:13 EST 2003


Greetings all,
 
I come to you with the hope the problem I have is easily fixed.
 
Anyway, our server owner decided it was time to install the latest
Debian hot fixes.  Unknown to him (and undocumented by the hot fix), it
proceeded to update Zope from 2.2 to 2.5.2 and Postgres from 6.5 to 7.2.
 Due to voluntary nature of our developers and the existence of legacy
stuff in our website, we needed to keep these older versions running
while a new website was built replacing our legacy stuff.
 
Luckily, the upgrade hasn't caused as much trouble as we thought it
would.  In fact, Zope and Postgres seem to have coped quite well with it
(thanking the big guy upstairs for that one).  We've just run into one
problem.
 
The current website uses a lot of <dtml-call "REQUEST.set...> calls to
push database field values to the top of the memory pile.  In the
previous version, if a returned value from the database was an integer,
the variable assigned that value in the REQUEST.set would also assume an
integer datatype.
 
So, if "SELECT count(*) as total from table_1" was a Z SQL Method
called in a DTML document and there was a <dtml-call
"REQUEST.set('table_1_total',total)"> in the DTML document, then
table_1_total would assume the datatype of integer.
 
The problem we have now is that in the above example, table_1_total is
assuming the datatype of string, so in fact, table_1_total = '0' not
table_1_total = 0.
 
This causes us problems all through the site, as any statement such
as:
 
<dtml-if expr="table_1_total > 0" will always be true, because '0' >
0.
 
Now, is there a way to fix this or is it a design feature of the later
versions of Zope/Python that requires a tightening of code?
 
Just wish we had the time to take the machine down and give it the new
hardware it needs so as we could have taken a rollback checkpoint prior
to the upgrade.
 
Any help greatly appreciated.
 
Wade Pearce
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20031222/58d9f274/attachment.html


More information about the Zope mailing list