]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
adding more mapper sections nobody will ever see !
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Feb 2010 20:42:19 +0000 (20:42 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Feb 2010 20:42:19 +0000 (20:42 +0000)
doc/build/examples.rst
doc/build/mappers.rst

index f91b8a69aaa4125eb86fb70df51246c185eec915..ae84b68069457b7e9f071960e68d077d2014c369 100644 (file)
@@ -7,6 +7,8 @@ The SQLAlchemy distribution includes a variety of code examples illustrating a s
 
 Additional SQLAlchemy examples, some user contributed, are available on the wiki at `<http://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.
 
+.. _examples_adjacencylist:
+
 Adjacency List
 --------------
 
@@ -113,6 +115,8 @@ Location: /examples/vertical
 
 .. automodule:: vertical
 
+.. _examples_xmlpersistence:
+
 XML Persistence
 ---------------
 
index 18ae039d9c0b66824c4316b6524a44b3e7cf0c6e..bafefa3758a27f85db5e46d8073a0aca38fdf63f 100644 (file)
@@ -825,6 +825,13 @@ example:
 
 The "non primary mapper" is a rarely needed feature of SQLAlchemy; in most cases, the ``Query`` object can produce any kind of query that's desired.  It's recommended that a straight ``Query`` be used in place of a non-primary mapper unless the mapper approach is absolutely needed.  Current use cases for the "non primary mapper" are when you want to map the class to a particular select statement or view to which additional query criterion can be added, and for when the particular mapped select statement or view is to be placed in a ``relation()`` of a parent mapper.
 
+Multiple "Persistence" Mappers for One Class 
+---------------------------------------------
+
+The non_primary mapper defines alternate mappers for the purposes of loading objects.  What if we want the same class to be *persisted* differently, such as to different tables ?   SQLAlchemy
+refers to this as the "entity name" pattern, and in Python one can use a recipe which creates
+anonymous subclasses which are distinctly mapped.  See the recipe at `Entity Name <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_.
+
 Constructors and Object Initialization 
 ---------------------------------------
 
@@ -1136,7 +1143,7 @@ And the bi-directional version combines both:
         'children': relation(Node, backref=backref('parent', remote_side=[nodes.c.id]))
     })
 
-There are several examples included with SQLAlchemy illustrating self-referential strategies; these include `basic_tree.py <http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/examples/adjacencytree/basic_tree.py>`_ and `optimized_al.py <http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/examples/elementtree/optimized_al.py>`_, the latter of which illustrates how to persist and search XML documents in conjunction with `ElementTree <http://effbot.org/zone/element-index.htm>`_.
+There are several examples included with SQLAlchemy illustrating self-referential strategies; these include :ref:`examples_adjacencylist` and :ref:`examples_xmlpersistence`.
 
 Self-Referential Query Strategies 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~