Trying to use the build-in python string functions like replace without success. I want to replace the slash with a dot in an URL (main/detail/form/index=> main.detail.form.index), but <dtml-let g="main/detail/form/index"> <dtml-var replace(g,'/','.')> </dtml-let> doesn't what i expect. It tries to call the object "replace(main/detail/form/index,'/','.')". Do i have to import the build-in functions? How? What's the way doing the replacement? with regards Axel
spending some time reading the zope documentation will answer most of the questions you have posted, and save bandwidth and the community's time. <dtml-let g="_.replace('main/detail/form/index','/','')"> <dtml-var g> </dtml-let> as for the zsql stuff, what gets returned is a brain which gets put onto the top of the namespace. in more intelligible words, just use the variables you selected in the query as normal dtml-vars. kapil On Sunday 11 March 2001 09:45, Axel Missbach wrote:
Trying to use the build-in python string functions like replace without success.
I want to replace the slash with a dot in an URL (main/detail/form/index=> main.detail.form.index), but
<dtml-let g="main/detail/form/index"> <dtml-var replace(g,'/','.')> </dtml-let>
doesn't what i expect. It tries to call the object "replace(main/detail/form/index,'/','.')".
Do i have to import the build-in functions? How?
What's the way doing the replacement?
with regards Axel
_______________________________________________ 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 )
\
as for the zsql stuff, what gets returned is a brain which gets put onto the top of the namespace. in more intelligible words, just use the variables you selected in the query as normal dtml-vars.
correcting myself, what gets returned is result object which contains the brains.
kapil
After spending very lot of time in reading the documentation i tried your offer myself. But there's an AttributError returned. ender wrote:
spending some time reading the zope documentation will answer most of the questions you have posted, and save bandwidth and the community's time.
<dtml-let g="_.replace('main/detail/form/index','/','')"> <dtml-var g> </dtml-let>
as for the zsql stuff, what gets returned is a brain which gets put onto the top of the namespace. in more intelligible words, just use the variables you selected in the query as normal dtml-vars.
kapil
On Sunday 11 March 2001 09:45, Axel Missbach wrote:
Trying to use the build-in python string functions like replace without success.
I want to replace the slash with a dot in an URL (main/detail/form/index=> main.detail.form.index), but
<dtml-let g="main/detail/form/index"> <dtml-var replace(g,'/','.')> </dtml-let>
doesn't what i expect. It tries to call the object "replace(main/detail/form/index,'/','.')".
Do i have to import the build-in functions? How?
What's the way doing the replacement?
with regards Axel
_______________________________________________ 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 )
On Sunday 11 March 2001 23:03, Axel Missbach wrote:
After spending very lot of time in reading the documentation i tried your offer myself. But there's an AttributError returned.
my mistake... reading the docs should have shown that this functionality is part of the string module... <dtml-var "_.string.replace('main/detail/form/index', '/', '')"> kapil
ender wrote:
spending some time reading the zope documentation will answer most of the questions you have posted, and save bandwidth and the community's time.
<dtml-let g="_.replace('main/detail/form/index','/','')"> <dtml-var g> </dtml-let>
<snip>
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Axel Missbach
I want to replace the slash with a dot in an URL (main/detail/form/index=> main.detail.form.index), but
<dtml-let g="main/detail/form/index"> <dtml-var replace(g,'/','.')> </dtml-let> Use a little magic variable. _ <dtml-let g="main/detail/form/index"> <dtml-var "_.replace(g,'/','.')"> </dtml-let> That might do it. regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
How about <dtml-var "_.string.replace('main/detail/form/index','/','')"> Using the let will put the vairable into namespace where where treats it like an object. If you only want to output the result, then ignore using let. If you wanted to use LocalFS or access an object that took on the name of the processed string, then you need the Let. Cheers, Paz Axel Missbach wrote:
Trying to use the build-in python string functions like replace without success.
I want to replace the slash with a dot in an URL (main/detail/form/index=> main.detail.form.index), but
<dtml-let g="main/detail/form/index"> <dtml-var replace(g,'/','.')> </dtml-let>
doesn't what i expect. It tries to call the object "replace(main/detail/form/index,'/','.')".
Do i have to import the build-in functions? How?
What's the way doing the replacement?
with regards Axel
_______________________________________________ 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 )
participants (4)
-
Axel.Missbach@t-online.de -
ender -
Max M -
Paul Zwarts