[ZODB-Dev] small Ape bug?
Adam Groszer
adamg at mailbox.hu
Tue May 27 11:34:40 EDT 2003
I found the following:
If I do the following:
class myGW(SQLGatewayBase):
__implements__ = SQLGatewayBase.__implements__
schema = FieldSchema('value', 'int')
table_base_name = 'value_data'
#column_defs = (
# ('value', 'int', 0),
# )
def load(self, event):
Ape does the column_defs for me, but when initializing, I get the following
stack trace:
Traceback (most recent call last):
File "P:\PMSpy\test\apetest2.py", line 326, in ?
x.setUp()
File "P:\PMSpy\test\apetest2.py", line 244, in setUp
storage = ApeStorage(resource, self.conns, clear_all=1)
File "C:\Python22\lib\site-packages\apelib\zodb3\storage.py", line 65, in
__in
it__
self.initDatabases(clear_all)
File "C:\Python22\lib\site-packages\apelib\zodb3\storage.py", line 114, in
ini
tDatabases
initializer.init(event)
File "C:\Python22\lib\site-packages\apelib\sql\sqlbase.py", line 47, in
init
self.execute(event, 'clear')
File "C:\Python22\lib\site-packages\apelib\sql\sqlbase.py", line 57, in
execut
e
query = conn.getQuery(
File "C:\Python22\lib\site-packages\apelib\sql\dbapi.py", line 65, in
getQuery
query = self.query_cache.get((table_name, column_defs, operation))
TypeError: list objects are unhashable
Looks like column_defs = [('value', 'int', 0)]
In turn the following works fine:
class myGW(SQLGatewayBase):
__implements__ = SQLGatewayBase.__implements__
schema = FieldSchema('value', 'int')
table_base_name = 'value_data'
column_defs = (
('value', 'int', 0),
)
def load(self, event):
Adam
More information about the ZODB-Dev
mailing list