<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: [Zope] REQUEST.set question</TITLE>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3314.2100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I don't think that acquisition works like that. I think
that you have to pass something to the python script, such as:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><dmtl-var "hello(REQUEST)"> </FONT></DIV>
<DIV><FONT size=2>or</FONT></DIV>
<DIV><FONT size=2><dtml-var "hello(REQUEST['nome'])"></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT size=2>Jonathan</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:Mark.Ferguson@NewellandBudge.com"
title=Mark.Ferguson@NewellandBudge.com>Ferguson, Mark</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A href="mailto:toolkit@magma.ca"
title=toolkit@magma.ca>'Small Business Services'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> December 3, 2003 9:36 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Zope] REQUEST.set
question</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=376583014-03122003><FONT color=#0000ff face=Arial size=2>Yes,
that will work but it isn't getting the parameter from the REQUEST object,
which is the behaviour I was trying (and failing) to implement...i.e. if the
parameter is not passed in the call, Zope is supposed to look for a match in
the REQUEST object and use that but, for me, that's not
happening.</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Small Business Services
[mailto:toolkit@magma.ca]<BR><B>Sent:</B> 03 December 2003
14:31<BR><B>To:</B> Ferguson, Mark<BR><B>Subject:</B> Re: [Zope] REQUEST.set
question<BR><BR></FONT></DIV>
<DIV><FONT size=2>Sorry, I read your original message too quickly. Try
the following call to your python script:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><dtml-var "hello('John')"></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>This should work.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT size=2>Jonathan</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:Mark.Ferguson@NewellandBudge.com"
title=Mark.Ferguson@NewellandBudge.com>Ferguson, Mark</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A href="mailto:toolkit@magma.ca"
title=toolkit@magma.ca>'Small Business Services'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> December 3, 2003 9:21 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Zope] REQUEST.set
question</DIV>
<DIV><BR></DIV>
<P><FONT size=2>Thanks for the input. I was really wondering why the
Python script</FONT> <BR><FONT size=2>version didn't work. FYI your DTML
didn't work as expected either when using 'name'. I changed it to 'nome'
and I worked. I think there is a clash in the namespace with 'name'.
Unfortunatly it didn't fix the Python version. ho hum...</FONT></P>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From:
Small Business Services [<A
href="mailto:toolkit@magma.ca">mailto:toolkit@magma.ca</A>]</FONT>
<BR><FONT size=2>Sent: 03 December 2003 14:04</FONT> <BR><FONT size=2>To:
Mark Ferguson</FONT> <BR><FONT size=2>Subject: Re: [Zope] REQUEST.set
question</FONT> </P><BR>
<P><FONT size=2>Mark wrote:</FONT> <BR><FONT size=2>> I'm going through
the code examples in the Zope Bible and I can't get the</FONT> <BR><FONT
size=2>> following to</FONT> <BR><FONT size=2>> work:</FONT>
<BR><FONT size=2>></FONT> <BR><FONT size=2>> I've created a
Python(Script) called 'hello' with 'name' on the parameter</FONT>
<BR><FONT size=2>> list and the following script body -</FONT>
<BR><FONT size=2>> return "Hello %s!" % name</FONT>
<BR><FONT size=2>></FONT> <BR><FONT size=2>> and a DTML Document
with -</FONT> <BR><FONT size=2>> <dtml-call
"REQUEST.set('name', 'John')"></FONT> <BR><FONT size=2>>
<dtml-var hello></FONT> <BR><FONT size=2>></FONT> <BR><FONT
size=2>> when I view the document I get</FONT> <BR><FONT size=2>>
Error Type: TypeError</FONT> <BR><FONT size=2>> Error Value: hello()
takes exactly 1 argument (0 given)</FONT> </P>
<P><FONT size=2>The REQUEST.set command creates a variable within the
REQUEST namespace</FONT> <BR><FONT size=2>called 'name' (in your example)
and places 'John' as the contents of that</FONT> <BR><FONT
size=2>variable.</FONT> </P>
<P><FONT size=2>To print out the contents of that variable:</FONT> </P>
<P><FONT size=2><p> this is html</FONT> <BR><FONT size=2>Hello
<dtml-var name><br></FONT> <BR><FONT size=2></p></FONT>
</P>
<P><FONT size=2>HTH</FONT> </P>
<P><FONT size=2>Jonathan</FONT> </P><FONT color=blue size=3><PRE>********************************************************************************
This electronic mail system is used for information purposes and is
not intended to form any legal contract or binding agreement.
The content is confidential and may be legally privileged. Access
by anyone other than the addressee(s) is unauthorised and any
disclosure, copying, distribution or any other action taken in
reliance on it is prohibited and maybe unlawful
All incoming and outgoing e-mail communications and attachments
are scanned automatically by software designed to detect and remove
any material containing viruses or other unauthorised content. While
we undertake best endeavours to ensure that this content checking
software is up to date, recipients should take steps to assure themselves
that e-mails received are secure.
***************************************************************************************
</PRE></BLOCKQUOTE></BLOCKQUOTE></FONT><FONT color=blue size=3><PRE>********************************************************************************
This electronic mail system is used for information purposes and is
not intended to form any legal contract or binding agreement.
The content is confidential and may be legally privileged. Access
by anyone other than the addressee(s) is unauthorised and any
disclosure, copying, distribution or any other action taken in
reliance on it is prohibited and maybe unlawful
All incoming and outgoing e-mail communications and attachments
are scanned automatically by software designed to detect and remove
any material containing viruses or other unauthorised content. While
we undertake best endeavours to ensure that this content checking
software is up to date, recipients should take steps to assure themselves
that e-mails received are secure.
***************************************************************************************
</PRE></BLOCKQUOTE></FONT></BODY></HTML>