[Zope] Re: Easy One

Bergen Moore bergen@globalexchange.org
Fri, 7 Mar 2003 11:54:25 -0800


--Apple-Mail-3-40188855
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

I just built a python script called url_quote (in my 'code' folder) and 
called it like so from dtml:
<dtml-var "webClient('http://192.168.0.1/getSqlResults?query=' + 
code.url_quote(querystring))">

The script: (with Parameter List having the parameter 'astring')
# Import a standard function
from Products.PythonScripts.standard import url_quote_plus

# Return a string suitable for URL's.
return "%s" % url_quote_plus(astring)


Ok .. this should be really easy but it's driving me nuts. How to I set
an attribute on a variable when it's being rendered inside of a
function? Here's what I mean:

<dtml-var "webClient('http://192.168.0.1/getSqlResults?query=' +
querystring)">

I need to have the variable querystring render with url_quote_plus, but
for the life of me I can't figure out how to set it.

TIA

Rick

--Apple-Mail-3-40188855
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

I just built a python script called url_quote (in my 'code' folder)
and called it like so from dtml:

<<dtml-var
"webClient('<underline><color><param>1A1A,1A1A,FFFF</param>http://192.168.0.1/getSqlResults?query</color></underline>='
+ code.url_quote(querystring))">


The script: (with Parameter List having the parameter 'astring')

# Import a standard function

from Products.PythonScripts.standard import url_quote_plus


# Return a string suitable for URL's.

return "%s" % url_quote_plus(astring)



Ok .. this should be really easy but it's driving me nuts. How to I set

an attribute on a variable when it's being rendered inside of a

function? Here's what I mean:


<<dtml-var
"webClient('<underline><color><param>1A1A,1A1A,FFFF</param>http://192.168.0.1/getSqlResults?query</color></underline>=' +

querystring)">


I need to have the variable querystring render with url_quote_plus, but

for the life of me I can't figure out how to set it.


TIA


Rick


--Apple-Mail-3-40188855--