Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

Zope3.3.0 - zope.rdb implementation - bug, feature or what?



Zope db RSS feed   Index | Next | Previous | View Threaded

maciej.wisniowski at coig

Oct 9, 2006, 9:48 AM

Post #1 of 1 (1259 views)
Zope3.3.0 - zope.rdb implementation - bug, feature or what?


First of all sorry if it is not correct list for this question
but there is no Zope3-DB... maybe Zope3-users or

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.

There is current implementation of RowClassFactory:

def RowClassFactory(columns):
"""Creates a Row object"""
klass_namespace = {}
klass_namespace['__Security_checker__'] = InstanceOnlyDescriptor(
klass_namespace['__slots__'] = tuple(columns)

return type('GeneratedRowClass', (Row,), klass_namespace)

in my case:

klass_namespace is {'__slots__':('1',)}

and '1' causes error.

select 1 as abc from dual

executes correctly.

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...?

Is this issue a bug or feature or something else. I'm not able to
recognise them myself (especially after submitting
request.locale issue on z3-five list :)).

I would like to know your's opinions
before submiting a bug and/or trying to create a patch.

Maciej Wisniowski
Zope-DB mailing list
Zope-DB [at] zope

Zope db RSS feed   Index | Next | Previous | View Threaded

Interested in having your list archived? Contact Gossamer Threads
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.