[Zope3-checkins] CVS: Zope3/src/zope/app/services - pagefolder.py:1.18

Jim Fulton jim at zope.com
Thu Feb 5 23:13:42 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv7660/src/zope/app/services

Modified Files:
	pagefolder.py 
Log Message:
Added an item-type constraint to page folders so that they can only
contain templates.


=== Zope3/src/zope/app/services/pagefolder.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/services/pagefolder.py:1.17	Tue Jan 13 14:32:23 2004
+++ Zope3/src/zope/app/services/pagefolder.py	Thu Feb  5 23:13:41 2004
@@ -26,6 +26,8 @@
 from zope.app.interfaces.services.registration import IRegistrationManager
 from zope.app.interfaces.services.registration import RegisteredStatus
 from zope.app.interfaces.services.registration import UnregisteredStatus
+from zope.app.interfaces.services.registration import IRegisterable
+from zope.app.container.constraints import ItemTypePrecondition
 from zope.app.services.presentation import PageRegistration
 from zope.app.services.registration import RegistrationManagerContainer
 from zope.app.services.zpt import IZPTTemplate
@@ -90,6 +92,12 @@
     def applyDefaults(self):
         """Apply the default configuration to the already-registered pages. 
         """
+
+    def __setitem__(name, template):
+        """Add a template to the folder
+        """
+
+    __setitem__.precondition = ItemTypePrecondition(IRegisterable)
 
 class PageFolder(RegistrationManagerContainer, BTreeContainer):
 




More information about the Zope3-Checkins mailing list