[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Basic Zope Objects

webmaster at zope.org webmaster at zope.org
Thu Nov 27 17:46:23 EST 2003


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/BasicObject.stx#3-47

---------------

      You can "test" a Script (Python) in the Workspace frame by
      clicking the *Test* tab from the Script's management screen.
      When you test a script, the output of the script will be
      displayed in your browser.  Script testing may require that you
      provide values for the script's *parameters* before you can view
      the results.  Click the *Test* tab of the SalesScript object,
      and you will see something like the following figure.

        % Anonymous User - Nov. 11, 2003 2:59 am:
         # Example code:

         # Import a standard function, and get the HTML request and response objects.
         from Products.PythonScripts.standard import html_quote
         request = container.REQUEST
         RESPONSE =  request.RESPONSE

         # Return a string identifying this script.
         print "This is the", script.meta_type, '"%s"' % script.getId(),
         if script.title:
             print "(%s)" % html_quote(script.title),
         print "in", container.absolute_url()
         return printed

        % Anonymous User - Nov. 27, 2003 5:46 pm:
         I get this:

         Zope Error
         Zope has encountered an error while publishing this resource.

         Error Type: NameError
         Error Value: global name 'name' is not defined

         --------------------------------------------------------------------------------

         Troubleshooting Suggestions

         This resource may be trying to reference a nonexistent object or variable global name 'name' is not defined. 
         The URL may be incorrect. 
         The parameters passed to this resource may be incorrect. 
         A resource that this resource relies on may be encountering an error. 
         For more detailed information about the error, please refer to the HTML source for this page. 

         If the error persists please contact the site maintainer. Thank you for your patience.



More information about the ZDP mailing list