diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-23 14:45:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-23 14:45:47 -0400 |
commit | 0efac1d93e27220f2aa1ec09b282fb08a7bb02be (patch) | |
tree | dbd806874a223253d0c8f52465a77f7e0754c7a8 /lib/sqlalchemy/orm/attributes.py | |
parent | df62f4501ee1ec37113477eb6a97068cc07faf5d (diff) | |
download | sqlalchemy-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/attributes.py')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index e71752ab5..0dd331354 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -16,11 +16,9 @@ defines a large part of the ORM's interactivity. import operator from operator import itemgetter -from sqlalchemy import util, event, exc as sa_exc, inspection -from sqlalchemy.orm import interfaces, collections, events, exc as orm_exc - - -mapperutil = util.importlater("sqlalchemy.orm", "util") +from .. import util, event, inspection +from . import interfaces, collections, events, exc as orm_exc +orm_util = util.importlater("sqlalchemy.orm", "util") PASSIVE_NO_RESULT = util.symbol('PASSIVE_NO_RESULT', """Symbol returned by a loader callable or other attribute/history @@ -415,8 +413,8 @@ class AttributeImpl(object): "but the parent record " "has gone stale, can't be sure this " "is the most recent parent." % - (mapperutil.state_str(state), - mapperutil.state_str(parent_state), + (orm_util.state_str(state), + orm_util.state_str(parent_state), self.key)) return @@ -675,8 +673,8 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): else: raise ValueError( "Object %s not associated with %s on attribute '%s'" % ( - mapperutil.instance_str(check_old), - mapperutil.state_str(state), + orm_util.instance_str(check_old), + orm_util.state_str(state), self.key )) value = self.fire_replace_event(state, dict_, value, old, initiator) |