]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- documented foreign_keys argument
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Feb 2007 04:46:08 +0000 (04:46 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Feb 2007 04:46:08 +0000 (04:46 +0000)
- 0.3.5 markers

doc/build/content/adv_datamapping.txt
doc/build/genhtml.py
setup.py

index c8c8ea784f051da618ef8812c32c18f6e60f6ed5..e1d6d92aa9591e3e0be7528bd6934bc127549362 100644 (file)
@@ -321,7 +321,9 @@ Options which can be sent to the `relation()` function.  For arguments to `mappe
 * **backref** - indicates the name of a property to be placed on the related mapper's class that will handle this relationship in the other direction, including synchronizing the object attributes on both sides of the relation.  Can also point to a `backref()` construct for more configurability.  See [datamapping_relations_backreferences](rel:datamapping_relations_backreferences).
 * **cascade** - a string list of cascade rules which determines how persistence operations should be "cascaded" from parent to child. For a description of cascade rules, see [datamapping_relations_lifecycle](rel:datamapping_relations_lifecycle) and [unitofwork_cascade](rel:unitofwork_cascade).
 * **collection_class** - a class or function that returns a new list-holding object.  will be used in place of a plain list for storing elements.  See [advdatamapping_properties_customlist](rel:advdatamapping_properties_customlist).
-* **foreignkey** - deprecated for most uses.  As of 0.3.2, use `remote_side` to indicate the direction of self-referential relationships.  For `ForeignKey` specification, this field is only partially functional (i.e. does not work for many-to-many relationships), but is needed in rare cases when both sides of the primaryjoin condition contain foreign keys to either side of the relationship, and `relation()` cannot determine which side of the relationship is "foreign".  a new field `foreign_keys` will be added in a future release to fully implement this functionality.
+* **foreign_keys** - a list of columns which are to be used as "foreign key" columns.  this parameter should be used in conjunction with explicit
+`primaryjoin` and `secondaryjoin` (if needed) arguments, and the columns within the `foreign_keys` list should be present within those join conditions.  Normally, `relation()` will inspect the columns within the join conditions to determine which columns are the "foreign key" columns, based on information in the `Table` metadata.  Use this argument when no ForeignKey's are present in the join condition, or to override the table-defined foreign keys.
+* **foreignkey** - deprecated.  use the `foreign_keys` argument for foreign key specification, or `remote_side` for "directional" logic.
 * **lazy=True** - specifies how the related items should be loaded.  a value of True indicates they should be loaded lazily when the property is first accessed.  A value of False indicates they should be loaded by joining against the parent object query, so parent and child are loaded in one round trip (i.e. eagerly).  A value of None indicates the related items are not loaded by the mapper in any case; the application will manually insert items into the list in some other way.  In all cases, items added or removed to the parent object's collection (or scalar attribute) will cause the appropriate updates and deletes upon flush(),  i.e. this option only affects load operations, not save operations.  
 * **order_by** - indicates the ordering that should be applied when loading these items.  See the section [advdatamapping_orderby](rel:advdatamapping_orderby) for details.
 * **passive_deletes=False** - Indicates if lazy-loaders should not be executed during the `flush()` process, which normally occurs in order to locate all existing child items when a parent item is to be deleted.  Setting this flag to True is appropriate when `ON DELETE CASCADE` rules have been set up on the actual tables so that the database may handle cascading deletes automatically.  This strategy is useful particularly for handling the deletion of objects that have very large (and/or deep) child-object collections.  See the example in [advdatamapping_properties_working](rel:advdatamapping_properties_working).
@@ -695,7 +697,7 @@ A self-referential mapper where there is more than one relationship on the table
         pass
 
     # define the "children" property as well as the "root" property
-    TreeNode.mapper = mapper(TreeNode, trees, properties={
+    mapper(TreeNode, trees, properties={
             'children' : relation(
                             TreeNode, 
                             primaryjoin=trees.c.parent_node_id==trees.c.node_id
index 2bf6b3eb4919de459957d1e35280824c162b0df0..4b6a0e4c592fbe6e59abe5c066cc8d195dbc34ff 100644 (file)
@@ -24,7 +24,7 @@ files = [
     ]
 
 title='SQLAlchemy 0.3 Documentation'
-version = '0.3.4'
+version = '0.3.5'
 
 root = toc.TOCElement('', 'root', '', version=version, doctitle=title)
 
index 4231a28a3efc71ba6e6f2015e09d12d5282fdd73..f0a588501d28f6fe92f344a4f8815927a9664934 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ use_setuptools()
 from setuptools import setup, find_packages
 
 setup(name = "SQLAlchemy",
-    version = "0.3.4",
+    version = "0.3.5",
     description = "Database Abstraction Library",
     author = "Mike Bayer",
     author_email = "mike_mp@zzzcomputing.com",