[Zope3-Users] Zope3.3.0-zope.rdb implementation - bug, feature?
Benji York
benji at zope.com
Fri Oct 13 08:44:24 EDT 2006
Maciej Wisniowski wrote:
> I've just tried to use Zope3.3.0 with cx_Oracle adapter
> and to check whether connection works I've used
> typical for Oracle statement:
>
> select 1 from dual
>
> I've received error:
> TypeError: __slots__ must be identifiers
>
> The problem is (I think) with class Row or
> RowClassFactory defined
> in zope/rdb/__init__.py.
Right, the RowClassFactory appears to assume that the column names are
valid Python identifiers, "1" is not. That doesn't seem like a good
assumption to me.
A workaround would be to rename any offending columns (forgive my rusty
SQL if this isn't quite right):
select 1 as one from dual
> I've implemented temporary solution that simply changes
> the names of numeric attributes (like '1') to prefixed ones
> (like '_1') It works but I'm not sure whether it is proper
> solution for something other than tests, but in general
> who may use this kind of dynamically created labels for
> something useful...?
Personally, I don't see zope.rdb being as very useful and would expect
to see third-party RDB interfaces supersede it.
> I would like to know your's opinions
> before submiting a bug and/or trying to create a patch.
I'd submit a bug report with the details you included in your email.
--
Benji York
Senior Software Engineer
Zope Corporation
More information about the Zope3-users
mailing list