[Zope-CVS] CVS: Products/ExternalMount - ExternalMount.py:1.2

Shane Hathaway shane@cvs.zope.org
Wed, 28 Aug 2002 13:50:28 -0400


Update of /cvs-repository/Products/ExternalMount
In directory cvs.zope.org:/tmp/cvs-serv10042

Modified Files:
	ExternalMount.py 
Log Message:
Avoid generating manage_afterAdd() events by adding a faux object to the
container then discreetly replacing it.  Ugly but functional. ;-)


=== Products/ExternalMount/ExternalMount.py 1.1.1.1 => 1.2 ===
--- Products/ExternalMount/ExternalMount.py:1.1.1.1	Wed Aug 21 16:11:25 2002
+++ Products/ExternalMount/ExternalMount.py	Wed Aug 28 13:50:27 2002
@@ -110,6 +110,10 @@
     f = ExternalMount(path, module, function)
     self = self.this()
     f._test(self)  # Test the connection.
+    # Add a faux object to avoid generating events while appeasing
+    # OFS.ObjectManager._setObject(), then discretely
+    # replace the faux object.
+    self._setObject(f.id, Folder())
     self._setOb(f.id, f)
     if REQUEST is not None:
         REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main')