Re: [Zope] ZOracleDA-beta5 problem; possible bug running NT
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 -- Stig-Arne Nordin
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
Behrens Matt - Grand Rapids wrote:
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.)
It works clean and simple, it is also documented in the DTML Reference:( The change in some of my variables i.e integers that once (with the alfa) were 12345 are now 12345L with the beta is an annoying glitch though. -- Stig-Arne Nordin CHALMERS | Göteborgs Universitet
participants (2)
-
Behrens Matt - Grand Rapids -
Stig-Arne Nordin