[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Adding.py:1.11.2.1 Contents.py:1.9.2.1 add.pt:1.5.4.1

Jim Fulton jim@zope.com
Sat, 30 Nov 2002 07:44:56 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv30047/lib/python/Zope/App/OFS/Container/Views/Browser

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	Adding.py Contents.py add.pt 
Log Message:
Refactored the way TTW component registration is done.  There are now
separate registry objects that abstract the machinery for registering
multiple conflicting configurations and deciding which, if any are
active.  Also provided a new field and widget for the status
information.

Along the way, cleaned up and streamlined placeful testing
infrastructure a bit.

Now checking into branch. Will give file-by-file (or at least more
specific logs) when the changes are merged into the head.


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Adding.py 1.11 => 1.11.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Adding.py:1.11	Mon Nov 18 18:52:59 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Adding.py	Sat Nov 30 07:44:25 2002
@@ -17,6 +17,7 @@
 """
 
 from Zope.App.OFS.Container.IAdding import IAdding
+from Zope.App.OFS.Container.IContainer import IContainerNamesContainer
 from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.Publisher.IPublishTraverse import IPublishTraverse
 from Zope.ComponentArchitecture \
@@ -101,7 +102,7 @@
         menu_service = getService(self.context, "BrowserMenu")
         return menu_service.getMenu(self.menu_id, self, self.request)
 
-    def action(self, type_name, id):
+    def action(self, type_name, id=''):
         if queryView(self, type_name, self.request) is not None:
             url = "%s=%s" % (type_name, id)
             self.request.response.redirect(url)
@@ -118,5 +119,6 @@
         self.add(content)
         self.request.response.redirect(self.nextURL())
 
-
+    def namesAccepted(self):
+        return not IContainerNamesContainer.isImplementedBy(self.context)
 


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.9 => 1.9.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py:1.9	Mon Nov 18 18:52:59 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py	Sat Nov 30 07:44:25 2002
@@ -61,9 +61,8 @@
 
     def removeObjects(self, ids):
         """Remove objects specified in a list of object ids"""
-        container = self.context
+        container = getAdapter(self.context, IZopeContainer)
         for id in ids:
-            container = getAdapter(container, IZopeContainer)
             container.__delitem__(id)
 
         self.request.response.redirect('@@contents.html')


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/add.pt 1.5 => 1.5.4.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/add.pt:1.5	Tue Oct 22 15:34:59 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/add.pt	Sat Nov 30 07:44:25 2002
@@ -85,7 +85,8 @@
 
   <tr>
     <td><br/></td>
-    <td><input type="text" name="id" />
+    <td>
+        <input type="text" name="id" tal:condition="view/namesAccepted" />
         <input type="submit" value=" Add " />
     </td>
   </tr>