[Zope] Use of Tokens
cesare@planningsrl.it
cesare@planningsrl.it
Wed, 26 Jan 2000 16:39:38 GMT
Hi all!
I have a strange error using tokens as parameters.
I am trying to pass to an SQLMethod a parameter typed as token
(MyParam:tokens) and the sqlmethod work fine inside the zope environment.
You can see the SQLMethod (1) ,if you want, at the end of the message.
Then I declared an DTMLMethod by wich the user can input the words to pass
to MyParam. You can see the DTMLMethod (2) at the end of the message
But from the input form, as soon as I run the SQLMethod I have got the
following error:
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: InError
Error Value: Strings are not allowed as input to the in tag.
What am I doing wrong?
Thank you in advanced,
Cesare
1) SQLMETHOD
select *
from mytable
<dtml-sqlgroup where>
<dtml-in MyParam>
<dtml-unless sequence-start> or </dtml-unless>
myfield like '%<dtml-var sequence-item>%'
</dtml-in>
</dtml-sqlgroup>
this sqlmethod generate (from inside the zope env) the following code:
select * from mytable where
myfield like "%firstword%"
or myfield like "%secondword%"
2) DTMLMethod
<dtml-var standard_html_header>
<TABLE CELLSPACING="2">
<dtml-in "MySQLMethod(MyParam='<dtml-var EditParola>')">
<TR> <TH ALIGN="LEFT" VALIGN="TOP">Id </TH>
<td align="center" valign="top">
<dtml-var myfield> [This is the field I want to show in table]
</TD></TR>
</dtml-in>
</TABLE>
</FORM>
<dtml-var standard_html_footer>
Cesare Raoss
Planning srl
Via Bolzano 45
38014 Gardolo (TN)
cesare@planningsrl.it
http://www.planningsrl.it