summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/relationships.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-06-23 14:45:47 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-06-23 14:45:47 -0400
commit0efac1d93e27220f2aa1ec09b282fb08a7bb02be (patch)
treedbd806874a223253d0c8f52465a77f7e0754c7a8 /lib/sqlalchemy/orm/relationships.py
parentdf62f4501ee1ec37113477eb6a97068cc07faf5d (diff)
downloadsqlalchemy-0efac1d93e27220f2aa1ec09b282fb08a7bb02be.tar.gz
- move all of orm to use absolute imports
- break out key mechanics of loading objects into new "orm.loading" module, removing implementation details from both mapper.py and query.py. is analogous to persistence.py - some other cleanup and old cruft removal
Diffstat (limited to 'lib/sqlalchemy/orm/relationships.py')
-rw-r--r--lib/sqlalchemy/orm/relationships.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py
index dc5adb90d..85fe2f3ac 100644
--- a/lib/sqlalchemy/orm/relationships.py
+++ b/lib/sqlalchemy/orm/relationships.py
@@ -13,12 +13,14 @@ and `secondaryjoin` aspects of :func:`.relationship`.
"""
-from sqlalchemy import sql, util, log, exc as sa_exc, schema
-from sqlalchemy.sql.util import ClauseAdapter, criterion_as_pairs, \
- join_condition, _shallow_annotate, visit_binary_product,\
+from .. import sql, util, exc as sa_exc, schema
+from ..sql.util import (
+ ClauseAdapter,
+ join_condition, _shallow_annotate, visit_binary_product,
_deep_deannotate, find_tables
-from sqlalchemy.sql import operators, expression, visitors
-from sqlalchemy.orm.interfaces import MANYTOMANY, MANYTOONE, ONETOMANY
+ )
+from ..sql import operators, expression, visitors
+from .interfaces import MANYTOMANY, MANYTOONE, ONETOMANY
def remote(expr):
"""Annotate a portion of a primaryjoin expression
@@ -220,7 +222,7 @@ class JoinCondition(object):
consider_as_foreign_keys=\
self.consider_as_foreign_keys or None
)
- except sa_exc.NoForeignKeysError, nfke:
+ except sa_exc.NoForeignKeysError:
if self.secondary is not None:
raise sa_exc.NoForeignKeysError("Could not determine join "
"condition between parent/child tables on "
@@ -240,7 +242,7 @@ class JoinCondition(object):
"with a ForeignKey or ForeignKeyConstraint, or "
"specify a 'primaryjoin' expression."
% self.prop)
- except sa_exc.AmbiguousForeignKeysError, afke:
+ except sa_exc.AmbiguousForeignKeysError:
if self.secondary is not None:
raise sa_exc.AmbiguousForeignKeysError(
"Could not determine join "
@@ -433,8 +435,6 @@ class JoinCondition(object):
if self._has_remote_annotations:
return
- parentcols = util.column_set(self.parent_selectable.c)
-
if self.secondary is not None:
self._annotate_remote_secondary()
elif self._local_remote_pairs or self._remote_side:
@@ -575,8 +575,6 @@ class JoinCondition(object):
if self._has_annotation(self.primaryjoin, "local"):
return
- parentcols = util.column_set(self.parent_selectable.c)
-
if self._local_remote_pairs:
local_side = util.column_set([l for (l, r)
in self._local_remote_pairs])