[Zope] Z SQL test in the ZMI aborts on key error (query keyerror Solution)

Allen Schmidt aschmidt at fredericksburg.com
Wed Jun 8 09:03:45 EDT 2005


Found it.
Edit lib/python/Shared/DC/dtml/customDefaultReport.dtml
Replace what is there with the code below (or compare and change)
This is from our 2.7.5 install.


<dtml-in %(id)s size=20 start=query_start>
   <dtml-if sequence-start>

      <dtml-if previous-sequence>

        <a href="&dtml-URL;&dtml-sequence-query;query_start=&dtml-previous-sequence-start-number;">
          (Previous <dtml-var previous-sequence-size> results)
        </a>

      </dtml-if previous-sequence>

      %(else no_table)[<table border>
        %(heading)s
      %(else)]

   </dtml-if sequence-start>

   %(row)s

   <dtml-if sequence-end>

      %(else no_table)[</table>%(else)]

      <dtml-if next-sequence>
         <a href="&dtml-URL;&dtml-sequence-query;query_start=&dtml-next-sequence-start-number;">
           (Next <dtml-var next-sequence-size> results)
         </a>

      </dtml-if next-sequence>
   </dtml-if sequence-end>

<dtml-else>

  There was no data matching this &dtml-title_or_id; query.

</dtml-in>



Allen


Dennis Allison wrote:

> I've never had any problem with parameterless queries.  (-:
> 
> No, this is a simple case of a parameter somehow being lost in 
> the ZMI interface.  
> 
> 
> On Tue, 7 Jun 2005, Joe Bezier wrote:
> 
> 
>>Hi there,
>>
>>By any chance are you trying to test a ZSQL method that doesn't 
>>(shouldn't) need any query parameters? For some reason (and I'm not the 
>>guy who can tell you why...) these types of tests always break - try 
>>adding '?query=' to the end of the URL. and see if that helps.
>>
>>Cheers,
>>
>>Joe.
>>On 7 Jun 2005, at 11:41, Dennis Allison wrote:
>>
>>
>>>Zope 2.7.6
>>>Python 2.3.5
>>>MySQLDA-1.2.1c3
>>>ZMYSQLDA-2.09b3
>>>
>>>
>>>Site Error
>>>
>>>An error was encountered while publishing this resource.
>>>
>>>Error Type: KeyError
>>>Error Value: 'query'
>>>
>>>Troubleshooting Suggestions
>>>
>>>    * This resource may be trying to reference a nonexistent object or
>>>variable 'query'.
>>>    * The URL may be incorrect.
>>>    * The parameters passed to this resource may be incorrect.
>>>    * A resource that this resource relies on may be encountering an
>>>error.
>>>
>>>
>>>----------
>>>Error log:
>>>
>>> 2005/06/07 03:33:03.344 GMT-7
>>>User Name (User Id) allison (allison)
>>>Request URL http://group1.agilemind.com/Scratch/simpleq/manage_test
>>>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'
>>>
>>>
>>>There does not seem to be a bug like this in the collectors.
>>>
>>>Any help/pointers appreciated.
>>>
>>>
>>>_______________________________________________
>>>Zope maillist  -  Zope at zope.org
>>>http://mail.zope.org/mailman/listinfo/zope
>>>**   No cross posts or HTML encoding!  **
>>>(Related lists -
>>> http://mail.zope.org/mailman/listinfo/zope-announce
>>> http://mail.zope.org/mailman/listinfo/zope-dev )
>>>
>>
>>
>>		
>>___________________________________________________________ 
>>How much free photo storage do you get? Store your holiday 
>>snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
>>
> 
> 




More information about the Zope mailing list