[Zope] Weird SQL Relay conversion error in Zope
mdriscoll at co.marshall.ia.us
Fri May 16 16:02:55 EDT 2008
> Mike Driscoll wrote at 2008-5-9 08:31 -0500:
>> I am working on a web app that interfaces with Microsoft SQL Server from Ubuntu through SQL Relay. I will be getting data from multiple databases. The issue seems to be that either Zope or SQL Relay cannot handle the Decimal type if the value is a null. If I do a query like this:
>> * Module Products.ZSQLRelayDA.db, line 86, in query
>> * Module decimal, line 571, in __new__
>> * Module decimal, line 2267, in _raise_error
>> InvalidOperation: (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: '@@plone')
> Looks like a bug in "ZSQLRelayDA.db".
> Apparently, it passes SQL decimal values to Python's "decimal" module --
> even if the SQL value is "Null" (almost surely mapped to Python's "None").
> For obvious reasons, "decimal" does not like to convert "None"
> into a "decimal" value.
> "ZSQLRelayDA.db" should test for "None" and call the "decimal"
> constructor only for non "None" values.
I suspected as much. I mentioned trying SQLAlchemy to my boss and he
tried it to see if it could handle this issue and it does. So we'll
probably stick with that, but thanks for the clarification.
More information about the Zope