[Zope3-checkins] CVS: Zope3/src/zope/app/container/browser - adding.py:1.5

Philipp von Weitershausen philikon at philikon.de
Mon May 10 02:38:54 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/container/browser
In directory cvs.zope.org:/tmp/cvs-serv5091/container/browser

Modified Files:
	adding.py 
Log Message:
cleanup


=== Zope3/src/zope/app/container/browser/adding.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/container/browser/adding.py:1.4	Thu May  6 11:46:04 2004
+++ Zope3/src/zope/app/container/browser/adding.py	Mon May 10 02:38:54 2004
@@ -18,8 +18,6 @@
 
 $Id$
 """
-__metaclass__ = type
-
 from warnings import warn
 import zope.security.checker
 from zope.interface import implements
@@ -28,11 +26,9 @@
 from zope.component.interfaces import IFactory
 
 from zope.app.exception.interfaces import UserError
-from zope.app.container.interfaces import IAdding
+from zope.app.container.interfaces import IAdding, INameChooser
 from zope.app.container.interfaces import IContainerNamesContainer
-from zope.app.container.interfaces import INameChooser
-from zope.app.container.constraints import checkFactory
-from zope.app.container.constraints import checkObject
+from zope.app.container.constraints import checkFactory, checkObject
 
 from zope.app import zapi
 from zope.app.event.objectevent import ObjectCreatedEvent
@@ -44,7 +40,6 @@
 from zope.i18n import translate
 from zope.app.location import LocationProxy
 
-
 class BasicAdding(BrowserView):
     implements(IAdding, IPublishTraverse)
 
@@ -83,10 +78,9 @@
         return (str(zapi.getView(self.context, "absolute_url", self.request))
                 + '/@@contents.html')
 
-    request = None # set in BrowserView.__init__
-
-    context = None # set in BrowserView.__init__
-
+    # set in BrowserView.__init__
+    request = None 
+    context = None
 
     def renderAddButton(self):
         warn("The renderAddButton method is deprecated, use nameAllowed",
@@ -112,7 +106,7 @@
         if view is not None:
             return view
 
-        factory = zapi.queryFactory(self.context, name)
+        factory = zapi.queryUtility(self.context, IFactory, name)
         if factory is None:
             return super(BasicAdding, self).publishTraverse(request, name)
 
@@ -172,7 +166,6 @@
 class Adding(BasicAdding):
 
     menu_id = None
-
     index = ViewPageTemplateFile("add.pt")
 
     def addingInfo(self):




More information about the Zope3-Checkins mailing list