[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Object Publishing

webmaster@zope.org webmaster@zope.org
Mon, 13 Jan 2003 10:24:32 -0500


A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx#4-18

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

        Once the published object is located with traversal, Zope
        *publishes* it in one of three possible ways.

          Calling the published object -- If the published object is a
          function or method or other callable object, the publisher
          calls it. Later in the chapter you'll find out how the
          publisher figures out what arguments to pass when calling.

          Calling the default method -- If the published object is not
          callable, the publisher uses the default method. For HTTP
          'GET' and 'POST' requests the default method is
          'index_html'. For other HTTP requests such as 'PUT' the
          publisher looks for a method named by the HTTP method. So for
          an HTTP 'HEAD' request, the publisher would call the 'HEAD'
          method on the published object.

          Stringifying the published object -- If the published object
          isn't callable, and doesn't have a default method, the
          publisher publishes it using the Python 'str' function to turn
          it into a string.

          % shh - Jan. 13, 2003 10:24 am:
           The order given in this paragraph is INCORRECT. If you look at the traverse() method you will find that
           ZPublisher tries the default method *first*, and only if this fails goes on with __call__() and __str__().