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

webmaster@zope.org webmaster@zope.org
Sat, 09 Nov 2002 14:12:51 -0500


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

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

    The Zope Product machinery "bootstraps" Product-based classes with
    proper constructors into the namespace of the Zope management
    interface "Add" list at Zope startup time.  This is done as a
    consequence of registering a class by way of the Product's
    '__init__.py' 'intialize' function.  If you want to make, for
    example, the imaginary 'FooClass' in your Product available from
    the "Add" list, you may construct an '__init__.py' file that looks
    much like this::

      from FooProduct import FooClass

      def initialize(context):
          """ Initialize classes in the FooProduct module """
          context.registerClass(
              FooProduct.FooClass, # the class object
              permission='Add FooClasses',
              constructors=(FooProduct.manage_addFooClassForm,
                            FooProduct.manage_addFooClass),
              icon='foo.gif'
              )

      % Anonymous User - Nov. 9, 2002 2:12 pm:
       /imaginary FooClass in your Product/imaginary FooClass Product/
       you mean the ZMI [Add list], not the products. Assume FooClass has no Add list. blf