[Zope] Re: using a variable plus attribute inside a DTML-CALL

Mitchell L Model mlm@acm.org
Thu, 4 Oct 2001 06:49:01 -0400


>  I am constructing a URL for a redirection based on a variable 'arg' 
>in the REQUEST.
>  I can use that variable in a DTML-CALL, as follows (helped by 
>discussions I found at
>  NIP from a while ago in this list, e.g.
> 
>http://zope.nipltd.com/public/lists/zope-archive.nsf/242bb7cc2b2c343d802568ab003585d4/54b2a6e5a68d088980256982004fea79?OpenDocument).
>
>  <dtml-call
>  expr="RESPONSE.redirect('http://www.zope.org/SiteIndex/search?text_content='
>                          + arg)">
>
>  However, I want to url_quote_plus the arg.  The usual variable 
>attribute syntax (either <dtml-var
>  arg.url_quote_plus> or &dtml.url_quote_plus.arg;) isn't available 
>inside the Python expression in the
>  dtml-call.  Without creating an external method to do the quoting, 
>how can I get the quoted version of the
>  variable inside the Python expression?  I've tried lots of 
>different ideas, but none worked.

Uh, help?!  No-one has answered this yet.  Perhaps it's so trivial 
everyone's waiting for someone else to do this?  I really need an 
answer!