'Configure the application with a :term:`session factory`.  If this
method is called, the ``factory`` argument must be a session
factory callable or a :term:`dotted Python name` to that factory.
.. note::
Using the ``session_factory`` argument to the
:class:`pyramid.config.Configurator` constructor can be used to
achieve the same purpose.'

@action_method
def set_session_factory(self, factory):

    factory = self.maybe_dotted(factory)
    def register():
        self.registry.registerUtility(factory, ISessionFactory)
    intr = self.introspectable('session    factory', None, self.object_description(factory), 'session    factory')
    intr['factory'] = factory
    self.action(ISessionFactory, register, introspectables=(intr,))
