]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
updates
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Jul 2009 21:07:52 +0000 (21:07 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Jul 2009 21:07:52 +0000 (21:07 +0000)
doc/build/mappers.rst
doc/build/reference/sqlalchemy/pooling.rst
doc/build/sqlexpression.rst

index 2dcd52fb3bef61ae7600c4781bd063425d24ed3f..2431cebce2eb5eed05c48c5cb50d4a49984002ab 100644 (file)
@@ -883,6 +883,7 @@ Multiple extensions will be chained together and processed in order; they are sp
 
 Relation Configuration 
 =======================
+
 Basic Relational Patterns 
 --------------------------
 
@@ -1339,6 +1340,8 @@ To enable the UPDATE after INSERT / UPDATE before DELETE behavior on ``relation(
 When a structure using the above mapping is flushed, the "widget" row will be INSERTed minus the "favorite_entry_id" value, then all the "entry" rows will be INSERTed referencing the parent "widget" row, and then an UPDATE statement will populate the "favorite_entry_id" column of the "widget" table (it's one row at a time for the time being).
 
 
+.. _advdatamapping_entitycollections:
+
 Alternate Collection Implementations 
 -------------------------------------
 
@@ -1354,7 +1357,7 @@ Mapping a one-to-many or many-to-many relationship results in a collection of va
     parent.children.append(Child())
     print parent.children[0]
 
-Collections are not limited to lists.  Sets, mutable sequences and almost any other Python object that can act as a container can be used in place of the default list.
+Collections are not limited to lists.  Sets, mutable sequences and almost any other Python object that can act as a container can be used in place of the default list, by specifying the ``collection_class`` option on ``relation()``.
 
 .. sourcecode:: python+sql
 
@@ -1368,7 +1371,6 @@ Collections are not limited to lists.  Sets, mutable sequences and almost any ot
     parent.children.add(child)
     assert child in parent.children
 
-.. _advdatamapping_entitycollections:
 
 Custom Collection Implementations 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1524,8 +1526,7 @@ The collections package provides additional decorators and support for authoring
 Configuring Loader Strategies: Lazy Loading, Eager Loading 
 -----------------------------------------------------------
 
-
-In the `datamapping`, we introduced the concept of **Eager Loading**.  We used an ``option`` in conjunction with the ``Query`` object in order to indicate that a relation should be loaded at the same time as the parent, within a single SQL query:
+In the :ref:`ormtutorial_toplevel`, we introduced the concept of **Eager Loading**.  We used an ``option`` in conjunction with the ``Query`` object in order to indicate that a relation should be loaded at the same time as the parent, within a single SQL query:
 
 .. sourcecode:: python+sql
 
@@ -1537,7 +1538,7 @@ In the `datamapping`, we introduced the concept of **Eager Loading**.  We used a
     WHERE users.name = ?
     ['jack']
 
-By default, all relations are **lazy loading**.  The scalar or collection attribute associated with a ``relation()`` contains a trigger which fires the first time the attribute is accessed, which issues a SQL call at that point:
+By default, all inter-object relationships are **lazy loading**.  The scalar or collection attribute associated with a ``relation()`` contains a trigger which fires the first time the attribute is accessed, which issues a SQL call at that point:
 
 .. sourcecode:: python+sql
 
index c7447869a46a9580612063898f3bdf422d612327..91e96819780b1371087e9f4ede6f6eb7bd3043fd 100644 (file)
@@ -134,7 +134,7 @@ The ``close()`` method will return the connection to the pool, and the
 ``cursor()`` method will return a proxied cursor object.  Both the
 connection proxy and the cursor proxy will also return the underlying
 connection to the pool after they have both been garbage collected,
-which is detected via the ``__del__()`` method.
+which is detected via weakref callbacks  (``__del__`` is not used).
 
 Additionally, when connections are returned to the pool, a
 ``rollback()`` is issued on the connection unconditionally.  This is
index 4d54d036bda150fed14b6233d759db17b81b8770..387013cacc9bee02bdbc53c9c2a7974b7fb27529 100644 (file)
@@ -784,7 +784,12 @@ SQL functions are created using the ``func`` keyword, which generates functions
     >>> print func.concat('x', 'y')
     concat(:param_1, :param_2)
     
-Certain functions are marked as "ANSI" functions, which mean they don't get the parenthesis added after them, such as CURRENT_TIMESTAMP:
+By "generates", we mean that **any** SQL function is created based on the word you choose::
+
+    >>> print func.xyz_my_goofy_function()
+    xyz_my_goofy_function()    
+    
+Certain function names are known by SQLAlchemy, allowing special behavioral rules to be applied.   Some for example are "ANSI" functions, which mean they don't get the parenthesis added after them, such as CURRENT_TIMESTAMP:
 
 .. sourcecode:: pycon+sql