[Zope] silly DTML question: "in" test

Bill Seitz fluxent at gmail.com
Wed Nov 28 13:20:38 EST 2007


I'm trying to do something in a DTML-Method (in ancient Zope 2.6.2)
that seems like it should be really simple, but I can't get it right.

I want to see if a value (defined via url-arg) is in a list which is
generated from an RDBMS query (field type=integer).

The pseudo-code would be something like:

if foo in (select foo_col from table where x=y)
then z='t'
else z='f'

I tried putting the simple SELECT query into a zSql and then calling it like:

<dtml-call "REQUEST.set('foo_list',IfShowNextDoor())">
<dtml-if expr="foo in foo_list">
	<dtml-call "REQUEST.set('z','t')">
<dtml-else>
	<dtml-call "REQUEST.set('z','f')">
</dtml-if>

But that doesn't work.


More information about the Zope mailing list