[Zope] parameter transfer to a zsql-method (lists, dictionaries etc.)

Elena Schulz elena.schulz at gmx.net
Fri Aug 8 11:01:35 EDT 2003


Hi,

I have problems with the parameter transfer to a zsql-method:

With the Test - Tab of the ZMI the following  ZSQL-method works fine without
passing any parameters (i.e. with the default values)
But if I call it with "return db.sql.device_list()",  with
"db.sql.device_list(['col1','col2'])" or  with
"db.sql.device_list(columns=['col1','col2'])"  from a script I get the given
errors.

Can anybody enlight my understandig of how to pass parameters (e.g. lists,
dictionaries) to zsql-methods especially so that they will work in an
dtml-in construct? That would be very helpfull.

--Thanks, Elena

my ZSQL-Method:

<params>columns:list:string=* where:string="" sort_col:string=""
sort_reverse:int=0</params>
SELECT
<dtml-in columns prefix=column>
 <dtml-var column_item fmt=sql-quote><dtml-unless column_end>,
</dtml-unless>
</dtml-in>

FROM device_list

the error details:

Error Type: InError
Error Value: Strings are not allowed as input to the in tag.
Error error_tb:

Traceback (innermost last):

    * Module ZPublisher.Publish, line 98, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module Shared.DC.Scripts.Bindings, line 252, in __call__
    * Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
    * Module Products.PythonScripts.PythonScript, line 315, in _exec
    * Module Script (Python), line 9, in test
      <PythonScript at /tomaxx/db/s/test>
      Line 9
    * Module Shared.DC.ZRDB.DA, line 415, in __call__
    * Module DocumentTemplate.DT_String, line 474, in __call__
    * Module DocumentTemplate.DT_In, line 636, in renderwob

InError: Strings are not allowed as input to the in tag.






More information about the Zope mailing list