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

Eckart Hertzler eckart at hertzler.de
Tue Apr 27 11:45:12 EDT 2004


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

Modified Files:
	adding.py 
Log Message:

added a check for preconditions to the add method


=== Zope3/src/zope/app/container/browser/adding.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/container/browser/adding.py:1.2	Sat Mar 13 23:44:50 2004
+++ Zope3/src/zope/app/container/browser/adding.py	Tue Apr 27 11:45:10 2004
@@ -30,6 +30,8 @@
 from zope.app.container.interfaces import IAdding
 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 import zapi
 from zope.app.event.objectevent import ObjectCreatedEvent
@@ -40,7 +42,6 @@
 from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.i18n import translate
 from zope.app.location import LocationProxy
-from zope.app.container.constraints import checkFactory
 
 
 class BasicAdding(BrowserView):
@@ -52,6 +53,9 @@
         container = self.context
         name = self.contentName
         chooser = INameChooser(container)
+
+        # check precondition
+        checkObject(container, name, content)
 
         if IContainerNamesContainer.providedBy(container):
             # The container pick's it's own names.




More information about the Zope3-Checkins mailing list