[Checkins] SVN: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py Method DocString added.

Charlie Clark charlie at begeistert.org
Wed Nov 16 16:47:22 UTC 2011


Log message for revision 123389:
  Method DocString added.

Changed:
  U   Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py

-=-
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py	2011-11-16 16:10:51 UTC (rev 123388)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py	2011-11-16 16:47:22 UTC (rev 123389)
@@ -15,6 +15,10 @@
 Choose ZODB to manage
 """
 
+import urllib
+from App.config import getConfiguration
+
+
 class View(object):
 
     def __init__(self, context, request):
@@ -24,7 +28,11 @@
     def __call__(self):
         return self.index()
 
-    def getDatabaseNames(self, quote=True):
-        return (('Main', 'main'),
-                ('Temporary', 'temporary')
-                )
\ No newline at end of file
+    def getDatabaseNames(self, quote=False):
+        """Return a sorted list of databases as a tuple (name, URL-quoted name)"""
+        configuration = getConfiguration()
+        names = configuration.dbtab.listDatabaseNames()
+        names.sort()
+        if quote is True:
+            return [(name, urllib.quote(name)) for name in names]
+        return names



More information about the checkins mailing list