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

Anthony Baxter anthony at interlink.com.au
Sat Feb 7 02:21:56 EST 2004


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

Modified Files:
	__init__.py 
Log Message:
SiteManager objects implemented their own name selection code. This
has been replaced with the standard NameChooser code. A shallow 
difference is that while services were created as ServiceName-1,
ServiceName-2, ..., they're now ServiceName, ServiceName-2, 
ServiceName-3. 


=== Zope3/src/zope/app/browser/services/service/__init__.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/browser/services/service/__init__.py:1.12	Sat Feb  7 00:35:08 2004
+++ Zope3/src/zope/app/browser/services/service/__init__.py	Sat Feb  7 02:21:25 2004
@@ -69,10 +69,9 @@
             l = id.rfind('.')
             if l >= 0:
                 id = id[l+1:]
-            i = 1
-            while ("%s-%s" % (id, i)) in self.context:
-                i=i+1
-            id = "%s-%s" % (id, i)
+            
+        chooser = zapi.getAdapter(self.context, INameChooser)
+        id = chooser.chooseName(id, None)
 
         # Call the superclass action() method.
         # As a side effect, self.added_object is set by add() above.




More information about the Zope3-Checkins mailing list