diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 17:48:29 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 17:48:29 -0400 |
| commit | 065fcbd9d2b463920d439c20d99a5a1cd7f216ed (patch) | |
| tree | 2230349df4cc7bc884f128e2c463c2e334152b7e /examples/elementtree/adjacency_list.py | |
| parent | 95c0214356a55b6bc051d2b779e54d6de7b0b22e (diff) | |
| download | sqlalchemy-065fcbd9d2b463920d439c20d99a5a1cd7f216ed.tar.gz | |
- The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term. relation() however will remain available
in equal capacity for the foreseeable future. [ticket:1740]
Diffstat (limited to 'examples/elementtree/adjacency_list.py')
| -rw-r--r-- | examples/elementtree/adjacency_list.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/elementtree/adjacency_list.py b/examples/elementtree/adjacency_list.py index b16dd780e..ad0f3f607 100644 --- a/examples/elementtree/adjacency_list.py +++ b/examples/elementtree/adjacency_list.py @@ -9,7 +9,7 @@ styles of persistence are identical, as is the structure of the main Document cl ################################# PART I - Imports/Coniguration #################################### from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey, Unicode, and_) -from sqlalchemy.orm import mapper, relation, create_session, lazyload +from sqlalchemy.orm import mapper, relationship, create_session, lazyload import sys, os, StringIO, re @@ -79,13 +79,13 @@ class _Attribute(object): # setup mappers. Document will eagerly load a list of _Node objects. mapper(Document, documents, properties={ - '_root':relation(_Node, lazy=False, cascade="all") + '_root':relationship(_Node, lazy=False, cascade="all") }) mapper(_Node, elements, properties={ - 'children':relation(_Node, cascade="all"), + 'children':relationship(_Node, cascade="all"), # eagerly load attributes - 'attributes':relation(_Attribute, lazy=False, cascade="all, delete-orphan"), + 'attributes':relationship(_Attribute, lazy=False, cascade="all, delete-orphan"), }) mapper(_Attribute, attributes) |
