diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 15:50:05 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 15:50:05 -0400 |
| commit | 27913554a85c308d81e6c018669d0246ceecc639 (patch) | |
| tree | 191305298ce66000c95c9c8fec1e27350f0d206e /examples/adjacency_list | |
| parent | 90571b3a3a4eca329ec14e9bd142ad2b96526d99 (diff) | |
| download | sqlalchemy-27913554a85c308d81e6c018669d0246ceecc639.tar.gz | |
trailing whitespace bonanza
Diffstat (limited to 'examples/adjacency_list')
| -rw-r--r-- | examples/adjacency_list/adjacency_list.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/adjacency_list/adjacency_list.py b/examples/adjacency_list/adjacency_list.py index 91c6e1ccf..1020cc57d 100644 --- a/examples/adjacency_list/adjacency_list.py +++ b/examples/adjacency_list/adjacency_list.py @@ -15,13 +15,13 @@ class TreeNode(Base): parent_id = Column(Integer, ForeignKey(id)) name = Column(String(50), nullable=False) - children = relationship("TreeNode", + children = relationship("TreeNode", # cascade deletions cascade="all", # many to one + adjacency list - remote_side - # is required to reference the 'remote' + # is required to reference the 'remote' # column in the join condition. backref=backref("parent", remote_side=id), @@ -46,7 +46,7 @@ class TreeNode(Base): return " " * _indent + repr(self) + \ "\n" + \ "".join([ - c.dump(_indent +1) + c.dump(_indent +1) for c in self.children.values()] ) @@ -107,7 +107,7 @@ if __name__ == '__main__': "selecting tree on root, using eager loading to join four levels deep.") session.expunge_all() node = session.query(TreeNode).\ - options(joinedload_all("children", "children", + options(joinedload_all("children", "children", "children", "children")).\ filter(TreeNode.name=="rootnode").\ first() |
