[Zope-DB] Re: Test for equality to Missing.Value (empty field)?

Jeff Kowalczyk jtk@yahoo.com
Mon, 25 Nov 2002 15:37:19 -0500


I agree, mxODBC is reasonably licensed; I'm going to check out the Zope mxODBC DA, which I
believe is still in beta at present.

In the meantime, I've been trying to research the mystery of 'Missing.Value', and how to
work effectively with it as a None equivalent.

It seems that I should be able to use repr() to treat the Missing.Value as a string and
compare it that way, or do a define and compare it to that instance. I have to watch it
when moving tal: expressions out to python scripts; I already have an explosion of them
that need to be culled and made more generic.

>>> results = app.myApp.sqlGetShipments(ShipmentDate='2002/11/01')
>>> results[2].ChargeAsPaid
Missing.Value
>>> type(results[2].ChargeAsPaid)
<extension class Missing.Missing at 017D30E0>
>>> mv =
>>> mv = results[2].ChargeAsPaid
>>> dir(mv)
[]
>>> type(mv)
<extension class Missing.Missing at 017D30E0>
>>> import Missing
>>> dir(Missing)
['MV', 'Missing', 'V', 'Value', '__doc__', '__file__', '__name__', '__version__']
>>> Missing.__file__
'C:\\PROGRA~1\\Zope\\lib\\python\\Missing.pyd'
>>> Missing.Value()
Missing.Value
>>> Missing.Value
Missing.Value
>>> type(Missing.Value)
<extension class Missing.Missing at 017D30E0>
>>> repr(mv)
'Missing.Value'
>>> mv == 'Missing.Value'
0
>>> repr(mv) == 'Missing.Value'
1
>>> mv == Missing.Value
1
>>>