[Zope] dtml-in SQL, results display

Alexander Batzios alexb@runbox.com
Wed, 10 Apr 2002 00:13:06 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0067_01C1E024.7D2B51C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi.

Thanks for the pointers in my previous question. After I knew what to =
search for, I looked up several Zope docs and did what I wanted. =
However, I would like to ask some more questions:

I have the following statement:

<dtml-in searchField>
OR
FirstNameMI like <dtml-sqlvar sequence-item type=3D"string">
OR
LastName like <dtml-sqlvar sequence-item type=3D"string">
</dtml-in>

Where searchField is returned as searchField:tokens. So far so good. I =
want to put % in front, and after every keyword. So I try something =
like:

FirstNameMI like <dtml-sqlvar expr=3D'%'+sequence-item+'%' =
type=3D"string">

However, because now I use an assignment operator for an expression, =
Zope takes sequence-item as two separate things, sequence minus item. Is =
there a way to work around this? I tried everything I could think of, =
but still the same. I would like to avoid having to use a simple =
dtml-var because I read in the docs that it's better for security this =
way (e.g. someone can't write DELETE * FROM tableName in the query).




My final question, is regarding the previous, next results navigation =
options. (e.g. Previous 5 results, or Next 5 results). How can I have =
these two side by side? It seems that if I take the previous results =
link from the top and put it at the bottom, it doesn't appear, because =
there are some <dtml-if> statements before.=20



Thanks in advance,
Alex


------=_NextPart_000_0067_01C1E024.7D2B51C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for the pointers in my previous =
question.=20
After I knew what to search for, I looked up several Zope docs and did =
what I=20
wanted. However, I would like to ask some more questions:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have the following =
statement:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>&lt;dtml-in=20
searchField&gt;<BR>OR<BR>FirstNameMI like &lt;dtml-sqlvar sequence-item=20
type=3D"string"&gt;<BR>OR<BR>LastName like &lt;dtml-sqlvar sequence-item =

type=3D"string"&gt;<BR>&lt;/dtml-in&gt;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Where searchField is returned as=20
searchField:tokens. So far so good. I want to put % in front, and after =
every=20
keyword. So I try something like:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV><FONT face=3DArial=20
size=3D2>FirstNameMI like &lt;dtml-sqlvar expr=3D'%'+sequence-item+'%'=20
type=3D"string"&gt;</FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However, because now I use an =
assignment operator=20
for an expression, Zope takes sequence-item as two separate things, =
sequence=20
minus item. Is there a way to work around this? I tried everything I =
could think=20
of, but still the same. I would like to avoid having to use a simple =
dtml-var=20
because I read in the docs that it's better for security this way (e.g. =
someone=20
can't write DELETE * FROM tableName in the query).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>My final question, is regarding the =
previous, next=20
results navigation options. (e.g. Previous 5 results, or Next 5=20
results).&nbsp;How can I have these two side by side? It seems that if I =
take=20
the previous results link from the top and put it at the bottom, it =
doesn't=20
appear, because there are some &lt;dtml-if&gt; statements before. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Alex</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0067_01C1E024.7D2B51C0--