[Zope] Redirecting a browser if len(someSQLQueryResult) == 1

Dieter Maurer dieter@handshake.de
Fri, 9 Nov 2001 22:08:52 +0100


Timothy Wilson writes:
 > ....
 > I can do <dtml-call
 > "RESPONSE.redirect('/info/dwelling_info/dwellingID/971335/attendanceAreaRpt')">,
 > but the obvious problem is that I've hardcoded the dwellingID. How can I
 > dynamically insert a portion of my SQL query (the dwellingID) into my
 > redirect?

   <dtml-call "RESPONSE.redirect('/info/dwelling_info/dwellingID/%s/attendanceAreaRpt' % '971335')">

Look at Python's format operator ("%") (--> Python reference).


Dieter