Commits

Jason R. Coombs committed b2b6d2f

Allow the datastore initialization to include a classmethod (such as MongoDBDataStore.from_uri)

Comments (0)

Files changed (1)

librarypaste/datastore.py

         return config['datastore']
     factory = config.pop('factory')
     if isinstance(factory, basestring):
-        "a string like 'package.module:Class'"
+        "a string like 'package.module:Class.classmethod'"
         module_name, _, factory_name = factory.partition(':')
         module = importlib.import_module(module_name)
-        factory = getattr(module, factory_name)
+        factory = eval(factory_name, module.__dict__)
     return factory(**config)
 
 class DataStore(object):