[Zope3-checkins] CVS: Zope3/src/zope/proxy/context - decorators.txt:1.1.2.4

Steve Alexander steve@cat-box.net
Sun, 18 May 2003 17:01:03 -0400


Update of /cvs-repository/Zope3/src/zope/proxy/context
In directory cvs.zope.org:/tmp/cvs-serv2467/proxy/context

Modified Files:
      Tag: stevea-decorators-branch
	decorators.txt 
Log Message:
Added usedfor attribute to decorator directive.
Updated docs.


=== Zope3/src/zope/proxy/context/decorators.txt 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/proxy/context/decorators.txt:1.1.2.3	Sun May 18 16:32:46 2003
+++ Zope3/src/zope/proxy/context/decorators.txt	Sun May 18 17:01:02 2003
@@ -175,7 +175,7 @@
    inner object.
    If all mixins were untrusted, we could allow "inheritence" of decorator
    registrations. But, this might be not such a good idea for reasons of
-   explicitness. Also, see TODO above.
+   explicitness. Also, see TODO above about combining checkers.
 
 The <decorate> directive
 ========================
@@ -218,13 +218,15 @@
       class="zope.app.some.mixin.Class"
       trusted="trusted"
       names="foo bar __iter__"
+      usedfor="zope.app.interfaces.thing.IFoo"
       >
     <require permission="zope.View" attributes="foo bar" />
     <allow interface="Iterable" />
   </decorator>
 
-TODO: Add decoratesInterface="some.Interface" attribute, for documentation
-      only.
+The 'usedfor' attribute is used to document the interface that the mixin's
+'inner' object should provide. In the current implementation, it is optional,
+and is used only for documentation.
 
 TODO: Make names *not* be taken from the permissions. The names specify the
       names that get forwarded to the decorator, and must be given explicitly.
@@ -236,9 +238,13 @@
 
 Note that __providedBy__ and __Security_checker__ are reserved names, and
 cannot be used.
+
+TODO: __providedBy__ and __Security_checker__ should be checked by the
+      ZCML handler.
+
 Note also that "slot" names, such as __getitem__ and __iter__ can be used only
-if they appear in the list of supported names.
-TODO: Give the place that the list can be found.
+if they appear in the list of supported names. This list can be found in
+Zope3/src/zope/proxy/interfaces/context.py in the docstring to IWrapper.
 
 Advantages
 ==========
@@ -376,9 +382,13 @@
       id="zope.app.container.contextdecorator"
       class="zope.app.container.zopecontainer.ZopeContainerDecorator"
       names="__getitem__ get values items setObject __delitem__ rename"
+      usedfor="zope.app.interfaces.container.IContainer"
       trusted="trusted">
     <require permission="zope.ManageContent" attributes="rename" />
   </decorator>
+
+The only permission needed is for "rename" because that is the only attribute
+in IZopeContainer that is not in IContainer.
 
 Here is the content directive for Folder: