I'd like to access it in a DTML method or Python Script. I just tried to program a small Python Script, but methods out of urlib can not be used :-(
Use an External Method then.
<dtml-let qs="buildQueryString(REQUEST.form, replace={'foo':'bar'})"> <a href="dtml-absolute_url;>?<dtml-qs>">foobar</a> </dtml-let>
A simple python method that loops through the form doesnt need urllib. eg: for k, v in context.REQUEST.form.items(): if k == 'foo': # do something else: somestr = '%s&%s=%s' % (somestr, k, v) Cheers. -- Andy McKay.
The purpose is to append the actual query string to a link. But I like to replace parts of the query! I'd like to build a link the following way (DTML snippet):
<dtml-let qs="buildQueryString(REQUEST.form, replace={'foo':'bar'})"> <a href="dtml-absolute_url;>?<dtml-qs>">foobar</a> </dtml-let>
So a form value of e.g. 'foo=xxx' would be replaced by 'foo=bar'.
I saw discussions about this topic in the list, but no answers with usable solutions. Did I miss it?
I don't like to make a Product to support this! Ok, if I need I'll would have to :-(
Greg _____________________________________ Grégoire Weber mailto:gregoire.weber@switzerland.org
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )