diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 16:03:51 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 16:03:51 -0400 |
commit | ae90ba28e85835c278c64d5894ee1a983d11e400 (patch) | |
tree | 45847bed623eb13d2da47b681fe5e19b2f54d472 | |
parent | 87bbba32bc54fa0253e9c81663df669dc355f5da (diff) | |
download | sqlalchemy-ae90ba28e85835c278c64d5894ee1a983d11e400.tar.gz |
fix import here
-rw-r--r-- | lib/sqlalchemy/ext/associationproxy.py | 8 | ||||
-rw-r--r-- | test/ext/test_associationproxy.py | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 8b3416ea9..01a4a933f 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -15,7 +15,7 @@ See the example ``examples/association/proxied_association.py``. import itertools import operator import weakref -from sqlalchemy import exceptions +from sqlalchemy import exc from sqlalchemy import orm from sqlalchemy import util from sqlalchemy.orm import collections, ColumnProperty @@ -295,7 +295,7 @@ class AssociationProxy(object): elif self.collection_class is set: return _AssociationSet(lazy_collection, creator, getter, setter, self) else: - raise exceptions.ArgumentError( + raise exc.ArgumentError( 'could not guess which interface to use for ' 'collection_class "%s" backing "%s"; specify a ' 'proxy_factory and proxy_bulk_set manually' % @@ -323,7 +323,7 @@ class AssociationProxy(object): elif self.collection_class is set: proxy.update(values) else: - raise exceptions.ArgumentError( + raise exc.ArgumentError( 'no proxy_bulk_set supplied for custom ' 'collection_class implementation') @@ -405,7 +405,7 @@ class _lazy_collection(object): def __call__(self): obj = self.ref() if obj is None: - raise exceptions.InvalidRequestError( + raise exc.InvalidRequestError( "stale association proxy, parent object has gone out of " "scope") return getattr(obj, self.target) diff --git a/test/ext/test_associationproxy.py b/test/ext/test_associationproxy.py index c9feddf4c..f260e65ce 100644 --- a/test/ext/test_associationproxy.py +++ b/test/ext/test_associationproxy.py @@ -1257,31 +1257,31 @@ class ComparatorTest(fixtures.MappedTest, AssertsCompiledSQL): def test_filter_scalar_contains_fails_nul_nul(self): Keyword = self.classes.Keyword - assert_raises(exceptions.InvalidRequestError, lambda : \ + assert_raises(exc.InvalidRequestError, lambda : \ Keyword.user.contains(self.u)) def test_filter_scalar_any_fails_nul_nul(self): Keyword = self.classes.Keyword - assert_raises(exceptions.InvalidRequestError, lambda : \ + assert_raises(exc.InvalidRequestError, lambda : \ Keyword.user.any(name='user2')) def test_filter_collection_has_fails_ul_nul(self): User = self.classes.User - assert_raises(exceptions.InvalidRequestError, lambda : \ + assert_raises(exc.InvalidRequestError, lambda : \ User.keywords.has(keyword='quick')) def test_filter_collection_eq_fails_ul_nul(self): User = self.classes.User - assert_raises(exceptions.InvalidRequestError, lambda : \ + assert_raises(exc.InvalidRequestError, lambda : \ User.keywords == self.kw) def test_filter_collection_ne_fails_ul_nul(self): User = self.classes.User - assert_raises(exceptions.InvalidRequestError, lambda : \ + assert_raises(exc.InvalidRequestError, lambda : \ User.keywords != self.kw) def test_join_separate_attr(self): |