passing parameters from dtml-method to Script (Python)
Hi!!! I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this. I have a dtml-method which does the following <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let> -- getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they jus do return "foo" -- return "bar" -- Now when i call the function gimmeBack(a=pid,b=bid), the pid and bid are not passed into the function. I am able to <dtml-var pid>, and it shows the value of pid. foo my gimmeBackMtd has return a No matter how i tried, I am just not able to make it work. But when I assign pid and bid with strings like <dtml-let pid="'foo'" bid="'bar'"> it works. Doesnt Script Python function return strings even if they appear to? Please help!!! Regards, R K ===== with "freedom" comes great responsibilities __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail
Sounds like you should just do this: <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <dtml-var getProdjectIdMTD><br> <dtml-var getBatchIdMTD> If you do not see what you expect then your python scripts (getProjectIdMTD, getBatchIdMTD) are failing in some way. If you cant solve this, show us your python scripts. David ----- Original Message ----- From: "R Karthick" <catchkarthick@yahoo.com> To: <zope@zope.org> Sent: Monday, July 12, 2004 8:08 PM Subject: [Zope] passing parameters from dtml-method to Script (Python)
Hi!!!
I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this.
I have a dtml-method which does the following
<dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let>
--
getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they jus do
return "foo"
--
return "bar"
--
Now when i call the function gimmeBack(a=pid,b=bid), the pid and bid are not passed into the function. I am able to <dtml-var pid>, and it shows the value of pid.
foo
my gimmeBackMtd has
return a
No matter how i tried, I am just not able to make it work. But when I assign pid and bid with strings like
<dtml-let pid="'foo'" bid="'bar'">
it works. Doesnt Script Python function return strings even if they appear to?
Please help!!!
Regards, R K
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
hi!! thank you for your reply. I tried doing that, and it actually printed the return value from the function. my script(python) is a simple script, it just contains, " getProjectIdMTD return "foo" -- " getBatchIdMTD return "bar" This is all it contains. I am able to get the output by <dtml-var ...> but only when i try sending it to another function as a parameter, the value is not passed. I hope you can understand the problem. Regards, R K ps: I would like to know whether there is any single point of documentation for zope, something like javadoc for java. It will make my life lot easier :) --- David Hassalevris <bluepaul@earthlink.net> wrote:
Sounds like you should just do this: <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <dtml-var getProdjectIdMTD><br> <dtml-var getBatchIdMTD> If you do not see what you expect then your python scripts (getProjectIdMTD, getBatchIdMTD) are failing in some way.
If you cant solve this, show us your python scripts.
David
----- Original Message ----- From: "R Karthick" <catchkarthick@yahoo.com> To: <zope@zope.org> Sent: Monday, July 12, 2004 8:08 PM Subject: [Zope] passing parameters from dtml-method to Script (Python)
Hi!!!
I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this.
I have a dtml-method which does the following
<dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let>
--
getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they jus do
return "foo"
--
return "bar"
--
Now when i call the function gimmeBack(a=pid,b=bid), the pid and bid are not passed into the function. I am able to <dtml-var pid>, and it shows the value of pid.
foo
my gimmeBackMtd has
return a
No matter how i tried, I am just not able to make it work. But when I assign pid and bid with strings like
<dtml-let pid="'foo'" bid="'bar'">
it works. Doesnt Script Python function return strings even if they appear to?
Please help!!!
Regards, R K
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
===== with "freedom" comes great responsibilities __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail
why do you use dtml? Tough it is not really depreciated yet, it is for sure on a declining branch. Better invest in learning Page templates. They are much clearer than dtml, and have fever "magic" that "you have to know since it is how it works" So having your two scripts you would use them like this in a template (note templates are pure html adorned with an xml name space): <span tal:content="here/foo" /> <span tal:replace="here/bar" /> <span tal:content="python:here.AScriptThatUsesParammeters(10,20)" /> The first span is "filled" with the result of the script. The second is replaced by the result. There will be no span tag in the resulting html. The third shows how to embed an arbitrary python code snippet. As you might have guested, "here" denotes the context in which the template is called. Robert R Karthick wrote:
hi!!
thank you for your reply.
I tried doing that, and it actually printed the return value from the function.
my script(python) is a simple script, it just contains,
" getProjectIdMTD return "foo"
--
" getBatchIdMTD return "bar"
This is all it contains. I am able to get the output by <dtml-var ...> but only when i try sending it to another function as a parameter, the value is not passed.
I hope you can understand the problem.
Regards, R K
ps: I would like to know whether there is any single point of documentation for zope, something like javadoc for java. It will make my life lot easier :)
--- David Hassalevris <bluepaul@earthlink.net> wrote:
Sounds like you should just do this: <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <dtml-var getProdjectIdMTD><br> <dtml-var getBatchIdMTD> If you do not see what you expect then your python scripts (getProjectIdMTD, getBatchIdMTD) are failing in some way.
If you cant solve this, show us your python scripts.
David
----- Original Message ----- From: "R Karthick" <catchkarthick@yahoo.com> To: <zope@zope.org> Sent: Monday, July 12, 2004 8:08 PM Subject: [Zope] passing parameters from dtml-method to Script (Python)
Hi!!!
I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this.
I have a dtml-method which does the following
<dtml-let pid="getProjectIdMTD"
bid="getBatchIdMTD">
<b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let>
--
getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they
jus
do
return "foo"
--
return "bar"
--
Now when i call the function
gimmeBack(a=pid,b=bid),
the pid and bid are not passed into the function.
I am
able to <dtml-var pid>, and it shows the value of
pid.
foo
my gimmeBackMtd has
return a
No matter how i tried, I am just not able to make
it
work. But when I assign pid and bid with strings
like
<dtml-let pid="'foo'" bid="'bar'">
it works. Doesnt Script Python function return
strings
even if they appear to?
Please help!!!
Regards, R K
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Tue, Jul 13, 2004, robert rottermann wrote:
why do you use dtml?
Because that's all that's covered in ``The Book of Zope''?
Tough it is not really depreciated yet, it is for sure on a declining branch. Better invest in learning Page templates. They are much clearer than dtml, and have fever "magic" that "you have to know since it is how it works"
I'm still very much on the early stages of learning Zope and Plone, having only started about a month ago, having built some simple Plone sites, and perused ``The Zope Book'', ``The Plone Book'', ``The Book of Zope'', ``Zope Web Application Development and Content Management'', and a couple of python books (I'm JAPH beginning to learn python). I have pretty much reached the conclusion that page templates are the only way to go if one wants to develop methods that play nicely in a Plone framework as one can use the standard macros to stay within the Plone layout rather than just doing full web pages. ... Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ A paranoid is a man who knows a little of what's going on. -- William S. Burroughs
Hi, A work around to your problem is using <dtml-let>: <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center> <dtml-let result="gimmeBack(a=pid,b=bid)"> <dtml-var result> </dtml-let> </center></b> </dtml-let> But this is a work around and there might be a better solution. For a response on a similar problem, check this posting on the Zope mailing list: http://mail.zope.org/pipermail/zope/2002-September/122617.html Regards, Satchit ZeOmega Infotech Pvt Ltd, http://www.zeomega.com R Karthick wrote:
Hi!!!
I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this.
I have a dtml-method which does the following
<dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let>
--
getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they jus do
return "foo"
--
return "bar"
--
Now when i call the function gimmeBack(a=pid,b=bid), the pid and bid are not passed into the function. I am able to <dtml-var pid>, and it shows the value of pid.
foo
my gimmeBackMtd has
return a
No matter how i tried, I am just not able to make it work. But when I assign pid and bid with strings like
<dtml-let pid="'foo'" bid="'bar'">
it works. Doesnt Script Python function return strings even if they appear to?
Please help!!!
Regards, R K
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
i think this will work for you ... <dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(_['pid'],_['bid'])"></center></b> </dtml-let> fritz (-:fs) ==================================================== Am Dienstag, 13. Juli 2004 05:08 tippte R Karthick:
Hi!!!
I am relatively a newbie to zope, this might b jus another newbie question. but i am really stuck in this.
I have a dtml-method which does the following
<dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD"> <b><center><dtml-var expr="gimmeBack(a=pid, b=bid)"></center></b> </dtml-let>
--
getProjectIdMTD and getBatchIdMtd are just script python methods, which return simple strings. they jus do
return "foo"
--
return "bar"
--
Now when i call the function gimmeBack(a=pid,b=bid), the pid and bid are not passed into the function. I am able to <dtml-var pid>, and it shows the value of pid.
foo
my gimmeBackMtd has
return a
No matter how i tried, I am just not able to make it work. But when I assign pid and bid with strings like
<dtml-let pid="'foo'" bid="'bar'">
it works. Doesnt Script Python function return strings even if they appear to?
Please help!!!
Regards, R K
===== with "freedom" comes great responsibilities
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (6)
-
Bill Campbell -
David Hassalevris -
R Karthick -
robert rottermann -
Satchidanand Haridas -
zope