[Zope] ZOracleDA-beta5 problem; possible bug running NT

Behrens Matt - Grand Rapids Matt.Behrens@Kohler.Com
Tue, 04 Sep 2001 11:47:03 -0400


Stig-Arne Nordin wrote:

> Behrens Matt - Grand Rapids wrote:
> 
>>Stig-Arne Nordin wrote:
>>
>> > If you encounter a null value in the datbase zope returns the value None
>> > under NT.
>> > At least if it is an integer field.
>>
>>I gather this is something new with the new DBAPI 2.0-based adapters.
>>In any event, the way to handle it is like so:
>>
>>        <dtml-var field null>
>>
>>"null" tells DTML to render "None" (which means no object) as an empty
>>string.


> What happens top me is that <dtml-var my_field> is rendered as None when
> the empty string is encountered. Maybe the None answer is default I
> don't know. However I want it to be rendered as 0 and the NVL returns
> 0.0 and and I can't emliminate the trailing .0


Whoops, sorry, I misunderstood.  I was thinking back to my misadventures with None :-)


Still, null is on the right track; it takes an argument, and therefore 
can be coaxed into doing what you want it to.

<dtml-var field null="0"> should work for you.  (Untested.)

-- 
Matt Behrens <matt.behrens@kohler.com>
System Analyst, Baker Furniture