[Checkins] SVN: z3c.saconfig/trunk/src/z3c/saconfig/ Fix test committed earlier by ldr

Brian Sutherland jinty at web.de
Wed Apr 1 17:26:51 EDT 2009


Log message for revision 98774:
  Fix test committed earlier by ldr

Changed:
  U   z3c.saconfig/trunk/src/z3c/saconfig/README.txt
  U   z3c.saconfig/trunk/src/z3c/saconfig/scopedsession.py

-=-
Modified: z3c.saconfig/trunk/src/z3c/saconfig/README.txt
===================================================================
--- z3c.saconfig/trunk/src/z3c/saconfig/README.txt	2009-04-01 21:13:34 UTC (rev 98773)
+++ z3c.saconfig/trunk/src/z3c/saconfig/README.txt	2009-04-01 21:26:50 UTC (rev 98774)
@@ -180,7 +180,7 @@
 
 In the example above we have set up SQLAlchemy with Zope using
 utilities, but it did not gain us very much, except that you can just
-use ``z3c.saconfig.Session`` to get the correct session.
+use ``zope.sqlalchemy.Session`` to get the correct session.
 
 Now we'll see how we can set up different engines per site by
 registering the engine factory as a local utility for each one.

Modified: z3c.saconfig/trunk/src/z3c/saconfig/scopedsession.py
===================================================================
--- z3c.saconfig/trunk/src/z3c/saconfig/scopedsession.py	2009-04-01 21:13:34 UTC (rev 98773)
+++ z3c.saconfig/trunk/src/z3c/saconfig/scopedsession.py	2009-04-01 21:26:50 UTC (rev 98774)
@@ -33,6 +33,14 @@
                             scoped_session(lambda:session_factory(name),
                                            lambda:scopefunc(name)))
 
+class _NamedScopedSessionDict:
+
+    def __getitem__(self, name):
+        return named_scoped_session(name)
+
+    def __setitem__(self, name, session):
+        _named_scoped_sessions[name] = session
+
 def install_sessions():
     from zope.sqlalchemy import install_sessions
-    install_sessions(_named_scoped_sessions)
+    install_sessions(_NamedScopedSessionDict())



More information about the Checkins mailing list