[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/registration - __init__.py:1.9.6.1

Jim Fulton jim at zope.com
Mon Sep 8 15:22:00 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	__init__.py 
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing.  Specific log entries will be provided
when we merge this into the head.


=== Zope3/src/zope/app/browser/services/registration/__init__.py 1.9 => 1.9.6.1 ===
--- Zope3/src/zope/app/browser/services/registration/__init__.py:1.9	Sun Aug 17 02:05:52 2003
+++ Zope3/src/zope/app/browser/services/registration/__init__.py	Mon Sep  8 14:21:29 2003
@@ -20,14 +20,16 @@
 from zope.app.browser.form.widget import RadioWidget, BrowserWidget
 from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.interfaces.browser.form import IBrowserWidget
-from zope.app.interfaces.container import IZopeContainer
-from zope.app.interfaces.services.registration import ActiveStatus, \
-     IComponentRegistration, UnregisteredStatus, IRegistered
+from zope.app.interfaces.container import IAddTarget, INameChooser
+from zope.app.interfaces.container import IRemoveSource
+
+from zope.app.interfaces.services.registration import IRegistered
+from zope.app.interfaces.services.registration import UnregisteredStatus
+from zope.app.interfaces.services.registration import IComponentRegistration
+from zope.app.interfaces.services.registration import ActiveStatus
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.app.traversing import getName, traverse
 from zope.component import getView, getServiceManager, getAdapter
-from zope.context import getWrapperContainer
-from zope.app.context import ContextWrapper
 from zope.proxy import removeAllProxies
 from zope.publisher.browser import BrowserView
 from zope.interface import implements
@@ -270,17 +272,12 @@
         component = self.context
 
         # Get the registration manager for this folder
-        folder = getWrapperContainer(component)
+        folder = component.__parent__
         configure = folder.getRegistrationManager()
 
-        # Adapt to IZopeContainer, which takes care of generating
-        # standard events and calling standard hooks
-        container = getAdapter(configure, IZopeContainer)
-
-        # Now add the item, saving the key, which is picked by the config
-        key = container.setObject("", registration)
-
-        # and return the config in context by fetching it from the container
+        name = getAdapter(configure, INameChooser).chooseName('', registration)
+        adder = getAdapter(configure, IAddTarget)
+        name = adder.addObject(name, registration)
         return container[key]
 
     def nextURL(self):
@@ -335,15 +332,14 @@
 
     def remove_objects(self, key_list):
         """Remove the directives from the container."""
-        container = getAdapter(self.context, IZopeContainer)
+        remover = getAdapter(self.context, IRemoveSource)
         for item in key_list:
-            del container[item]
+            remover.removeObject(key)
 
     def configInfo(self):
         """Render View for each directives."""
         result = []
         for name, configobj in self.context.items():
-            configobj = ContextWrapper(configobj, self.context, name=name)
             url = str(getView(configobj, 'absolute_url', self.request))
             active = configobj.status == ActiveStatus
             summary1 = getattr(configobj, "usageSummary", None)




More information about the Zope3-Checkins mailing list