[Zope] REQUEST.set question

Small Business Services toolkit at magma.ca
Wed Dec 3 09:45:53 EST 2003


RE: [Zope] REQUEST.set questionI don't think that acquisition works like that.  I think that you have to pass something to the python script, such as:

<dmtl-var "hello(REQUEST)"> 
or
<dtml-var "hello(REQUEST['nome'])">


Jonathan

  ----- Original Message ----- 
  From: Ferguson, Mark 
  To: 'Small Business Services' 
  Sent: December 3, 2003 9:36 AM
  Subject: RE: [Zope] REQUEST.set question


  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.
    -----Original Message-----
    From: Small Business Services [mailto:toolkit at magma.ca]
    Sent: 03 December 2003 14:31
    To: Ferguson, Mark
    Subject: Re: [Zope] REQUEST.set question


    Sorry, I read your original message too quickly.  Try the following call to your python script:

    <dtml-var "hello('John')">

    This should work.


    Jonathan


      ----- Original Message ----- 
      From: Ferguson, Mark 
      To: 'Small Business Services' 
      Sent: December 3, 2003 9:21 AM
      Subject: RE: [Zope] REQUEST.set question


      Thanks for the input. I was really wondering why the Python script 
      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...

      -----Original Message----- 
      From: Small Business Services [mailto:toolkit at magma.ca] 
      Sent: 03 December 2003 14:04 
      To: Mark Ferguson 
      Subject: Re: [Zope] REQUEST.set question 



      Mark wrote: 
      > I'm going through the code examples in the Zope Bible and I can't get the 
      > following to 
      > work: 
      > 
      > I've created a Python(Script) called 'hello' with 'name' on the parameter 
      > list and the following script body - 
      >   return "Hello %s!" % name 
      > 
      > and a DTML Document with - 
      >   <dtml-call "REQUEST.set('name', 'John')"> 
      >   <dtml-var hello> 
      > 
      > when I view the document I get 
      > Error Type: TypeError 
      > Error Value: hello() takes exactly 1 argument (0 given) 

      The REQUEST.set command creates a variable within the REQUEST namespace 
      called 'name' (in your example) and places 'John' as the contents of that 
      variable. 

      To print out the contents of that variable: 

      <p> this is html 
      Hello <dtml-var name><br> 
      </p> 

      HTH 

      Jonathan 

********************************************************************************
  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.
***************************************************************************************

********************************************************************************
  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.
***************************************************************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zope.org/pipermail/zope/attachments/20031203/32b26193/attachment.html


More information about the Zope mailing list