I just wanted to thank you very, very, VERY much for that tip! I've spent
far too many hours debugging very long, complex Z SQL methods. This will be
an enormous help! By the way, it works like a charm on ZMySQLDA.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Casey Duncan
Sent: Thursday, September 07, 2000 4:26 PM
To: [EMAIL PROTECTED]
Subject: [Zope-dev] Z SQL Method Patch
In debugging some Z SQL methods I found it quite hard to diagnose certain
errors returned by the database backend because Zope doesn't return the SQL
sent to the server, instead it returns "Could not render the query
template!" which is not really true for this case.
In looking at the source code of DA.py (lib/python/Shared/DC/ZRDB), and I
think I found a simple solution:
in manage_test insert the following indented after line 343 (except:)
try: src=self(REQUEST, src__=1)
This re-renders the query template if possible without sending it to the
backend and returns the SQL in src. The result is your backend error message
followed by the SQL generated. This should really save time debugging any
dynamic Z SQL methods.
It was moderately tested on Zope 2.2.1/PostgreSQL 7 via PyGreSQLDA. It
should not be database dependant though.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -