using url_quote outsite dtml-var
Hi, I am constructing URL strings in dtml like so: <dtml-call "REQUEST.set('link',BASE2 + '/' +sometext"> where I must to use the url_quote on sometext. Like with <dtml-var sometext url_quote>. I tried: sometext.url_quote, resultet in string-object has no attribute url_quote. _.url_quote(sometext) does also not work. any hint welcome Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163
On Mon, Apr 30, 2001 at 12:04:40AM +0200, Joachim Schmitz wrote:
Hi,
I am constructing URL strings in dtml like so:
<dtml-call "REQUEST.set('link',BASE2 + '/' +sometext">
where I must to use the url_quote on sometext. Like with
<dtml-var sometext url_quote>. I tried:
sometext.url_quote, resultet in string-object has no attribute url_quote. _.url_quote(sometext) does also not work.
any hint welcome
unless i'm missing the point completely, i think you need to look at: http://www.zope.org/Members/AlexR/EntitySyntax hth, -- charlie blanchard http://baldguru.com/ LosAngeles area Zope Users Group http://lazug.org
On Sun, 29 Apr 2001, Charlie Blanchard wrote:
On Mon, Apr 30, 2001 at 12:04:40AM +0200, Joachim Schmitz wrote:
Hi,
I am constructing URL strings in dtml like so:
<dtml-call "REQUEST.set('link',BASE2 + '/' +sometext">
where I must to use the url_quote on sometext. Like with
<dtml-var sometext url_quote>. I tried:
sometext.url_quote, resultet in string-object has no attribute url_quote. _.url_quote(sometext) does also not work.
any hint welcome
unless i'm missing the point completely, i think you need to look at:
yes you do ;-), so I didn't make it clear enough. I want (have) to do something like: <dtml-call "REQUEST.set('link',BASE2 + '/' + _.url_quote(sometext)"> ^^^^^^^^^^^ that does not work Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163
Joachim Schmitz wrote:
<dtml-call "REQUEST.set('link',BASE2 + '/' + _.url_quote(sometext)"> ^^^^^^^^^^^ that does not work
Write a python script, url_quote, taking one parameter, text: from Products.PythonScripts.standard import url_quote return url_quote(text) Put that in the root and then, thanks to the magic of acquisition, you can use it anywhere: <dtml-call "REQUEST.set('link',BASE2 + '/' + url_quote(sometext)"> cheers, Chris
When I call ZSQL Methods from a python script, I don't seem to be able to get the attribute values passed in properly. My script kinda goes like this... answer = context.REQUEST['answer'] Thingy = something_else context.create_answer_sql(answer=answer, thingy=thingy) ...and the values don't turn up in the database if I use <dtmlsql-var answer type=string> but do if I use <dtml-var answer>, but then the quote escaping fails.. I assume this is a namespace problem, any ideas on how to fix it? Thanks tom
answer = context.REQUEST['answer'] Thingy = something_else
context.create_answer_sql(answer=answer, thingy=thingy)
That's perfect! Smells bug or some simple misstake. what does this return?: answer = context.REQUEST['answer'] Thingy = something_else print "Answer: (%s) \nThingy: (%s)"%(answer, thingy) context.create_answer_sql(answer='dummyvalue', thingy='staticstring') return printed Cheers, Peter
...and the values don't turn up in the database if I use <dtmlsql-var answer type=string> but do if I use <dtml-var answer>, but then the quote escaping fails..
I assume this is a namespace problem, any ideas on how to fix it?
Thanks
tom
_______________________________________________ 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 )
From: "tom smith" <tom@othermedia.com>
context.create_answer_sql(answer=answer, thingy=thingy)
...and the values don't turn up in the database if I use <dtmlsql-var answer type=string> but do if I use <dtml-var answer>, but then the quote escaping fails..
You do have "answer thingy" in the parameters box of the ZSQL Method, right? Cheers, Evan @ digicool & 4-am
participants (6)
-
Charlie Blanchard -
Chris Withers -
Evan Simpson -
Joachim Schmitz -
Peter Bengtsson -
tom smith