[Zope] tokens and multiple in sqltest

milos.prudek@worldonline.cz milos.prudek@worldonline.cz
Wed, 18 Jul 2001 22:27:38 +0200


I'm baffled by Zope behaviour with multiple option of sqltest.

I have a Z SQL method list_art_writers:
--- list_art_writers ---
SELECT fname, lname FROM writers WHERE <sqltest m_id type=nb multiple>;
--- end ---

This method has a single parameter: m_id:tokens

This ZSQL method works perfectly when called from a test interface.


It also works OK when called from a form:
--- list_art_form ---
<form action=list_art_method>
<input name="m_id:tokens">
</form>
--- end ---

... where list_art_method is simply:
--- list_art_method ---
<dtml-in list_art_writers><dtml-var fname></dtml-in>
--- end ---

but, but.... when m_id is not gathered from a form, but is rather a
datasheet "m_id" property of a ZClass "ORL_Art" (the type of this
property is tokens), it does not work:

--- list_art_writers ---
  <dtml-in expr="objectValues('ORL_Art')">
  <tr> 
    <td valign="top">&dtml-a_id;</td>
    <td> <a href="&dtml-absolute_url;"
target="_parent">&dtml-title;</a></td>
    <td>
    <dtml-in list_art_writers>
           <dtml-var fname><dtml-unless sequence-end>,</dtml-unless>
    </dtml-in>

    </td>
    <td>&nbsp;</td>
    <td>45%</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td colspan="4"><font size="-2"><dtml-var abstract></font></td>
  </tr>
  </dtml-in>
--- list_art_writers

The list_art_writers works fine, except for <dtml-in list_art_writers>
section, which gives:
Error Type: Bad Request
Error Value: ['m_id']
Traceback (innermost last):
  File /usr/src/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line
223, in publish_module
  File /usr/src/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/src/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/src/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /usr/src/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line
160, in mapply
    (Object: list_art)
  File /usr/src/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: list_art)
  File /usr/src/Zope-2.3.2-src/lib/python/OFS/DTMLMethod.py, line 189,
in __call__
    (Object: list_art)
  File /usr/src/Zope-2.3.2-src/lib/python/DocumentTemplate/DT_String.py,
line 538, in __call__
    (Object: list_art)
  File /usr/src/Zope-2.3.2-src/lib/python/DocumentTemplate/DT_In.py,
line 717, in renderwob
    (Object: objectValues('ORL_Art'))
  File /usr/src/Zope-2.3.2-src/lib/python/DocumentTemplate/DT_In.py,
line 650, in renderwob
    (Object: list_art_writers)
  File /usr/src/Zope-2.3.2-src/lib/python/Shared/DC/ZRDB/DA.py, line
476, in __call__
    (Object: list_art_writers)
  File /usr/src/Zope-2.3.2-src/lib/python/Shared/DC/ZRDB/Aqueduct.py,
line 150, in _argdata
    (Object: list_art_writers)
Bad Request: (see above)

I use Zope 2.3.2.

--
Milos Prudek