Error calling a Z SQL method
I am calling a Z SQL method from within a DTML method that is called by a DTML document. The Z SQL method is contained within a folder called 'selects'. The error I get is as follows: Error Type: ValueError Error Value: Strings are not allowed as input to the in tag. The following is the syntax I use to call the DTML method from the DTML document: <dtml-call "initialize_parameters(REQUEST, _)"> And, the following is the code I use to call the Z SQL method (i.e. retrieve_data_sql) from within the DTML method (i.e. initialize_parameters): <dtml-in "selects.retrieve_data_sql()"> </dtml-in> I have used this same piece of code in other places without a problem. Any help would be greatly appreciated. Thanks. - Asad
This looks wrong to me, even if you have used it before. I would use the query like this: <dtml-in retrieve_data_sql> <dtml-var Column1> <dtml-var Column2> <br> </dtml-in> The REQUEST object is available to the ZSQL Method so you don't need to pass it explicitly. And you don't really need two DTML thingies - one will do. HTH Cliff Asad Habib wrote:
I am calling a Z SQL method from within a DTML method that is called by a DTML document. The Z SQL method is contained within a folder called 'selects'. The error I get is as follows:
Error Type: ValueError Error Value: Strings are not allowed as input to the in tag.
The following is the syntax I use to call the DTML method from the DTML document:
<dtml-call "initialize_parameters(REQUEST, _)">
And, the following is the code I use to call the Z SQL method (i.e. retrieve_data_sql) from within the DTML method (i.e. initialize_parameters):
<dtml-in "selects.retrieve_data_sql()"> </dtml-in>
I have used this same piece of code in other places without a problem. Any help would be greatly appreciated. Thanks.
- Asad _______________________________________________ Zope maillist - Zope@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 )
Well, I have to specify the folder that contains the Z SQL method so your code won't work with my structure. I appreciate your input. Thanks. - Asad On Thu, 24 Mar 2005, Cliff Ford wrote:
This looks wrong to me, even if you have used it before. I would use the query like this:
<dtml-in retrieve_data_sql> <dtml-var Column1> <dtml-var Column2> <br> </dtml-in>
The REQUEST object is available to the ZSQL Method so you don't need to pass it explicitly. And you don't really need two DTML thingies - one will do.
HTH
Cliff
Asad Habib wrote:
I am calling a Z SQL method from within a DTML method that is called by a DTML document. The Z SQL method is contained within a folder called 'selects'. The error I get is as follows:
Error Type: ValueError Error Value: Strings are not allowed as input to the in tag.
The following is the syntax I use to call the DTML method from the DTML document:
<dtml-call "initialize_parameters(REQUEST, _)">
And, the following is the code I use to call the Z SQL method (i.e. retrieve_data_sql) from within the DTML method (i.e. initialize_parameters):
<dtml-in "selects.retrieve_data_sql()"> </dtml-in>
I have used this same piece of code in other places without a problem. Any help would be greatly appreciated. Thanks.
- Asad _______________________________________________ Zope maillist - Zope@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 )
Sorry, I misunderstood your question. My suggestion should have read like this: <dtml-with selects> <dtml-in retrieve_data_sql> <dtml-var Column1> <dtml-var Column2> <br> </dtml-in> </dtml-with> Have a look for DTML Namespace in the Zope Book. Cliff Asad Habib wrote:
Well, I have to specify the folder that contains the Z SQL method so your code won't work with my structure. I appreciate your input. Thanks.
- Asad
On Thu, 24 Mar 2005, Cliff Ford wrote:
This looks wrong to me, even if you have used it before. I would use the query like this:
<dtml-in retrieve_data_sql> <dtml-var Column1> <dtml-var Column2> <br> </dtml-in>
The REQUEST object is available to the ZSQL Method so you don't need to pass it explicitly. And you don't really need two DTML thingies - one will do.
HTH
Cliff
Asad Habib wrote:
I am calling a Z SQL method from within a DTML method that is called by a DTML document. The Z SQL method is contained within a folder called 'selects'. The error I get is as follows:
Error Type: ValueError Error Value: Strings are not allowed as input to the in tag.
The following is the syntax I use to call the DTML method from the DTML document:
<dtml-call "initialize_parameters(REQUEST, _)">
And, the following is the code I use to call the Z SQL method (i.e. retrieve_data_sql) from within the DTML method (i.e. initialize_parameters):
<dtml-in "selects.retrieve_data_sql()"> </dtml-in>
I have used this same piece of code in other places without a problem. Any help would be greatly appreciated. Thanks.
- Asad _______________________________________________ Zope maillist - Zope@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 )
_______________________________________________ Zope maillist - Zope@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 )
Asad Habib wrote at 2005-3-24 14:18 -0500:
I am calling a Z SQL method from within a DTML method that is called by a DTML document. The Z SQL method is contained within a folder called 'selects'. The error I get is as follows:
Error Type: ValueError Error Value: Strings are not allowed as input to the in tag.
The error message tells you: The argument to a "dtml-in" is a string. "ZSQLMethod"s do not return strings. Thus, probably, your problem is at a different place (than you think). -- Dieter
Dieter, I get the following error at startup (Zope 2.7.6-final, Python 2.3.4, ZopeProfiler 1.1 in a multi-headed Zope/ZEO configuration with shared session variables. My hypothesis is that the culprit is the ZopeProfiler and that I need to move to Version 1.4. Are there any problems using it in a Zope/ZEO environment? --- Unhandled exception in thread started by <class ZServer.PubCore.ZServerPublisher.ZServerPublisher at 0x40467d1c> Traceback (most recent call last): File "/usr/local/src/zope/Zope2.7/lib/python/ZServer/PubCore/ZServerPublisher.py", line 23, in __init__ response=response) File "/opt2/zope/zproducts/standard/ZopeProfiler/MonkeyPatcher.py", line 35, in __call__ return self._function(*args,**kw) File "/opt2/zope/zproducts/standard/ZopeProfiler/ZopeProfiler.py", line 335, in _profilePublishModule _hookApplicationManager() File "/opt2/zope/zproducts/standard/ZopeProfiler/ZopeProfiler.py", line 383, in _hookApplicationManager R._p_jar.close() File "/usr/local/src/zope/Zope2.7/lib/python/Products/ZODBMountPoint/Mount.py", line 210, in close self._real_close() File "/usr/local/src/zope/Zope2.7/lib/python/ZODB/Connection.py", line 306, in close raise ConnectionStateError("Cannot close a connection joined to " ZODB.POSException.ConnectionStateError: Cannot close a connection joined to a transaction
Dennis Allison wrote at 2005-5-10 08:25 -0700:
... My hypothesis is that the culprit is the ZopeProfiler and that I need to move to Version 1.4.
Indeed is the problem you report fixed in version 1.4.
Are there any problems using it in a Zope/ZEO environment?
Not that I know of.
... _hookApplicationManager() File "/opt2/zope/zproducts/standard/ZopeProfiler/ZopeProfiler.py", line 383, in _hookApplicationManager R._p_jar.close() File "/usr/local/src/zope/Zope2.7/lib/python/Products/ZODBMountPoint/Mount.py", line 210, in close self._real_close() File "/usr/local/src/zope/Zope2.7/lib/python/ZODB/Connection.py", line 306, in close raise ConnectionStateError("Cannot close a connection joined to " ZODB.POSException.ConnectionStateError: Cannot close a connection joined to a transaction
-- Dieter
participants (4)
-
Asad Habib -
Cliff Ford -
Dennis Allison -
Dieter Maurer