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

webmaster@zope.org webmaster@zope.org
Wed, 06 Nov 2002 10:57:23 -0500


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

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

        When using Zope rather than publishing your own modules, the
        publisher uses acquisition to locate user folders and perform
        security checks. The upshot of this is that your published
        objects must inherit from 'Acquisition.Implicit' or
        'Acquisition.Explicit'. See Chapter 5, "Acquisition", for more
        information about these classes. Also when traversing each
        object must be returned in an acquisition context. This is
        done automatically when traversing via 'getattr', but you must
        wrap traversed objects manually when using '__getitem__' and
        '__bobo_traverse__'. For example::

          class Example(Acquisition.Explicit):
              ...

              def __bobo_traverse__(self, name, request):
                  ...
                  next_object=self._get_next_object(name)
                  return  next_object.__of__(self)      

          % Anonymous User - Nov. 6, 2002 10:57 am:
           It may be worth making a reference to this from the reference to __bobo_traverse__ earlier in the chapter.