Trouble with ZSQL method
Hello, all. Apologies in advance for the long lines in the error message. I'm running Solaris 7, Zope 2.3.3, MySQL 3.23.28-gamma, ZMySQLDA 2.0.7, and MySQLdb 0.9.0. I'm trying to get the following ZSQL method name sql_select_single to work: select servicedesc, serviceid as parentid from z_service where <dtml-sqltest servicename op=eq type=string> Yes, servicename is defined as a parameter. When I test it manually, it's great. When I try to test it with the following bit of DTML: <dtml-let servicename="'CIP'"> <p class="bodynorm"> <dtml-var servicename> </p> <dtml-var expr="sql.test_select_single()"> </dtml-let> I get the following wonderful error: Zope Error Zope has encountered an error while publishing this resource. Error Type: Bad Request Error Value: ['servicename'] -------------------------------------------------------------------------------- Troubleshooting Suggestions 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. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py, line 540, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py, line 540, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Let.py, line 149, in render (Object: servicename="'CIP'") File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Util.py, line 339, in eval (Object: sql.sql_select_single()) (Info: sql) File <string>, line 0, in ? File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA.py, line 476, in __call__ (Object: sql_select_single) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/Aqueduct.py, line 150, in _argdata (Object: sql_select_single) Bad Request: (see above) What am I doing wrong? -- Devin L. Ganger <devin@thecabal.org> A man, a miss, a car -- a curve, He kissed the miss and missed the curve -- Burma Shave (1948)
Hi all, I´m spanish and I have bad English! ;-D. I know this. It´s a spacename problem, see down ... From: "Devin L. Ganger" <devin@thecabal.org> To: <zope@zope.org> Sent: Thursday, September 06, 2001 4:35 AM Subject: [Zope] Trouble with ZSQL method
When I test it manually, it's great. When I try to test it with the following bit of DTML:
<dtml-let servicename="'CIP'">
<p class="bodynorm"> <dtml-var servicename> </p>
<dtml-var expr="sql.test_select_single()">
Ups!, It´s here!, the name space, mmm... , try passing '_' argument, <dtml-var expr="sql.test_select_single(_)"> It must work!
</dtml-let>
I get the following wonderful error:
Zope Error Zope has encountered an error while publishing this resource.
Error Type: Bad Request Error Value: ['servicename']
An advise to you. When you find this error always try to do a <dtml-var variable> of the Error Value, to see if the variable is in namespace. Later you can put in all functions _ and/or _.None to pass to the Method the actual namespace. I wish I have helped you. Regards. Antonio Carrasco "If you look heedfully Reality, you will be able to see pixels."
You might try sending this to the zope-db@zope.org, which is specifically for zope/database type questions.... Russell On Wednesday 05 September 2001 22:35, you wrote:
Hello, all. Apologies in advance for the long lines in the error message.
I'm running Solaris 7, Zope 2.3.3, MySQL 3.23.28-gamma, ZMySQLDA 2.0.7, and MySQLdb 0.9.0.
I'm trying to get the following ZSQL method name sql_select_single to work:
select servicedesc, serviceid as parentid from z_service where <dtml-sqltest servicename op=eq type=string>
Yes, servicename is defined as a parameter.
When I test it manually, it's great. When I try to test it with the following bit of DTML:
<dtml-let servicename="'CIP'">
<p class="bodynorm"> <dtml-var servicename> </p>
<dtml-var expr="sql.test_select_single()">
</dtml-let>
I get the following wonderful error:
Zope Error Zope has encountered an error while publishing this resource.
Error Type: Bad Request Error Value: ['servicename']
--------------------------------------------------------------------------- -----
Troubleshooting Suggestions
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. For more detailed information about the error, please refer to the HTML source for this page.
If the error persists please contact the site maintainer. Thank you for your patience.
Traceback (innermost last): File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p y, line 223, in publish_module File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p y, line 187, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p y, line 171, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py , line 160, in mapply (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p y, line 112, in call_object (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_ String.py, line 540, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_ String.py, line 540, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_ Let.py, line 149, in render (Object: servicename="'CIP'") File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_ Util.py, line 339, in eval (Object: sql.sql_select_single()) (Info: sql) File <string>, line 0, in ? File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA.py , line 476, in __call__ (Object: sql_select_single) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/Aqued uct.py, line 150, in _argdata (Object: sql_select_single) Bad Request: (see above)
What am I doing wrong?
Devin L. Ganger wrote: [snip]
Yes, servicename is defined as a parameter.
[snip]
<dtml-var expr="sql.test_select_single()">
doesn't look like to me that you are passing the method any parameters. what happens if you do... <dtml-var expr="sql.test_select_single(servicename=servicename)">
</dtml-let>
I get the following wonderful error:
Zope Error Zope has encountered an error while publishing this resource.
Error Type: Bad Request Error Value: ['servicename']
--------------------------------------------------------------------------------
Troubleshooting Suggestions
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. For more detailed information about the error, please refer to the HTML source for this page.
If the error persists please contact the site maintainer. Thank you for your patience.
Traceback (innermost last): File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py, line 540, in __call__ (Object: index_html) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py, line 540, in __call__ (Object: index_docs) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Let.py, line 149, in render (Object: servicename="'CIP'") File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Util.py, line 339, in eval (Object: sql.sql_select_single()) (Info: sql) File <string>, line 0, in ? File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA.py, line 476, in __call__ (Object: sql_select_single) File /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/Aqueduct.py, line 150, in _argdata (Object: sql_select_single) Bad Request: (see above)
What am I doing wrong?
-- Tom Jenkins devIS - Development Infostructure http://www.devis.com
participants (4)
-
Antonio Carrasco -
Devin L. Ganger -
Russell Hires -
Tom Jenkins