I solved this by sending the arg via url mangling to a DTML method and then by normal args to the ZSQL method. Yes, even the ZOPE book describes that it should work the other way. Lee On 13-Mar-01 Paul Zwarts wrote:
Lee,
I have had all sorts of similar problems with this, especially when I started working on a system that used MySql instead of PostgreSQL....
Is the dtml document/method sending the variable as an int or str?
<dtml-call "toZQLMethod(requestid=_.int(something)">
That should probably work. I had to convert a whole bunch of them when I moved databases.... can anyone explain to us WHY this is?
Cheers,
Paz
Lee Marzke wrote:
Why doesn't calling dir/request_by_id/requestid/7 work with the following ZSQL method ?
== request_by_id ZSQL method == <params>requestid:int</params>
select * from table WHERE requestid=<dtml-sqlvar requestid type=int >
I get the following error:
Invalid integer value for requestid
Traceback (innermost last): File /sw/scm/usr/var/Zope230/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /sw/scm/usr/var/Zope230/lib/python/ZPublisher/Publish.py, line 187, in publish File /sw/scm/usr/var/Zope230/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: request_by_id) File /sw/scm/usr/var/Zope230/lib/python/ZPublisher/Publish.py, line 162, in publish File /sw/scm/usr/var/Zope230/lib/python/ZPublisher/BaseRequest.py, line 363, in traverse File /sw/scm/usr/var/Zope230/lib/python/Shared/DC/ZRDB/DA.py, line 519, in __getitem__ (Object: request_by_id) File /sw/scm/usr/var/Zope230/lib/python/Shared/DC/ZRDB/DA.py, line 482, in __call__ (Object: request_by_id) File /sw/scm/usr/var/Zope230/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: <string>) File /sw/scm/usr/var/Zope230/lib/python/Shared/DC/ZRDB/sqlvar.py, line 183, in render (Object: requestid) ValueError: (see above)
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Lee Marzke <lmarzke@kns.com> 13-Mar-01, 13:15:55 Kulicke & Soffa Industries 2101 Blair Mill Rd +1 215 784-6217 Willow Grove, PA 19090 +1 215 784-6014 fax