[Checkins] SVN: z3c.sqlalchemy/trunk/ updated

Andreas Jung andreas at andreas-jung.com
Sun May 25 06:02:28 EDT 2008


Log message for revision 86940:
  updated
  

Changed:
  U   z3c.sqlalchemy/trunk/CHANGES.txt
  U   z3c.sqlalchemy/trunk/README.txt

-=-
Modified: z3c.sqlalchemy/trunk/CHANGES.txt
===================================================================
--- z3c.sqlalchemy/trunk/CHANGES.txt	2008-05-25 05:29:27 UTC (rev 86939)
+++ z3c.sqlalchemy/trunk/CHANGES.txt	2008-05-25 10:02:27 UTC (rev 86940)
@@ -1,4 +1,4 @@
-1.2.0 (unreleased)
+1.2.0 (25.05.2008)
 ------------------
 
   - now using zope.sqlalchemy for ZODB transaction integration

Modified: z3c.sqlalchemy/trunk/README.txt
===================================================================
--- z3c.sqlalchemy/trunk/README.txt	2008-05-25 05:29:27 UTC (rev 86939)
+++ z3c.sqlalchemy/trunk/README.txt	2008-05-25 10:02:27 UTC (rev 86940)
@@ -60,7 +60,7 @@
 Usage
 =====
 
-Basic usage from within a pure Python application::
+Basic usage: 
 
    from z3c.sqlalchemy import createSAWrapper
    wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB')
@@ -69,26 +69,17 @@
    for row in session.query(FormatMapper).select(...): print row
    session.flush() # if necessary
 
-When using Zope 2/3 you can use the same code but you want a wrapper that
-participates in Zope transactions. For this purpose you must use the additional
-parameter 'forZope'::
+The session will participate automatically in a Zope transaction.  The wrapper
+will call automatically session.flush() upon a transaction commit.  Please note
+that 'wrapper.session' will always return the same session instance within the
+same transaction and same thread.
 
-   from z3c.sqlalchemy import createSAWrapper
-   wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', forZope=True)
-   session = wrapper.session
-
-In this case the session will participate automatically in a Zope transaction.
-The wrapper will call automatically session.flush() upon a transaction commit.
-Please note that 'wrapper.session' will always return the same session instance
-within the same transaction and same thread.
-
 For a real-world application you don't want to create a new wrapper for every
 new request.  Instead you want to register a wrapper instance as named utility
 (ISQLAlchemyWrapper) and lookup up the wrapper (the utility!) by name from
 within your application. This approach is very similiar to looking up an
 databases adapter or a ZSQL method through acquisition.
    
-
 By default "wrapper.getMapper(name)" will always auto-generate a new mapper
 class by using SQLAlchemy auto-load feature. The drawback of this approach is
 that the mapper class does not know about relationships to other tables. Assume



More information about the Checkins mailing list