[egenix-users] mxodbc_zope_da_1.0.9 problem: KeyError, query

RJ Juneau rj at maxxian.com
Thu May 5 11:47:14 CEST 2005


Charlie,

I found a fix. Here it is in case anyone else runs into this.

You were correct - the problem is in another part of Zope. Based on your
feedback, I did a bit more searching and found something here:

	
http://mail.zope.org/pipermail/zope-collector-monitor/2005-April/005362.
html

The problem appears to be in Zope versions after 2.7.0. I'm running
2.7.6, and the post indicates that it also happens in 2.7.4.

The solution:

Edit file <Zope
Directory>/lib/python/Shared/DC/ZRDB/dtml/customDefaultReport.dtml.

There are two lines in the file that start with <a href=...>. Edit them
as follows:

Change first line to:
<a
href="&dtml-URL;&dtml-sequence-query;query_start=&dtml-previous-sequence
-start-number;">

Change second line to:
<a
href="&dtml-URL;&dtml-sequence-query;query_start=&dtml-next-sequence-sta
rt-number;">

Just to be after, I shut down Zope before I made the changes and
restarted it after.

Thanks for the help!

RJ

-----Original Message-----
From: RJ Juneau [mailto:rj at maxxian.com] 
Sent: May 5, 2005 9:22 AM
To: 'Charlie Clark'
Cc: 'egenix-users at lists.egenix.com'
Subject: RE: [egenix-users] mxodbc_zope_da_1.0.9 problem: KeyError,
query


At this point, I'm still only trying to display the query results within
the "Test" tab of the ZSQL method. I have not called the ZSQL method
from any template yet on this system.

-----Original Message-----
From: Charlie Clark [mailto:charlie at egenix.com] 
Sent: May 5, 2005 9:01 AM
To: RJ Juneau
Cc: egenix-users at lists.egenix.com
Subject: RE: [egenix-users] mxodbc_zope_da_1.0.9 problem: KeyError,
query



On 2005-05-05 at 14:37:42 [+0200], RJ Juneau <rj at maxxian.com> wrote:
> 
> 
> More interesting info on the problem:
> 
> If I execute the query directly in the "test" window of the base
> eGenix mxODBC Database Connection window, it works fine and returns 
> the 20 lines expected. That could point to a problem in the rendering,

> which seems to be where the traceback ends.
> 
> Note that within the same Zope system I also have an ODBC connection
> to a Sybase database, and I have successfully tested multi-line ZSQL 
> queries there.
> 
> This is the traceback:
> 
>     Time    2005/05/05 07:55:15.294 GMT-4    
> 
>     Exception Type    KeyError    
>     Exception Value    'query'    
> 
>     Traceback (innermost last):
>     Module ZPublisher.Publish, line 101, in publish
>     Module ZPublisher.mapply, line 88, in mapply
>     Module ZPublisher.Publish, line 39, in call_object
>     Module Shared.DC.ZRDB.DA, line 337, in manage_test
>     Module DocumentTemplate.DT_String, line 474, in __call__
>     Module DocumentTemplate.DT_In, line 602, in renderwb
>     Module DocumentTemplate.DT_Var, line 219, in render
>     KeyError: 'query'

This is definitely a problem in your DTML or some other part of Zope.
Zope 
is raising a KeyError which means something is missing from a mapping.
Are 
you trying to display the query itself?

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
 >>> Python/Zope Consulting and Support ...
http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...
http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...
http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

This mail is marked as non spam by Pinjo revealer, spamfilter
technology. ( http://www.pinjo.nl )



More information about the egenix-users mailing list