diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-05-07 12:52:25 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-05-07 12:52:25 -0400 |
commit | 4bc2402cc0bc585af1d0e7d59000f73cf20cf452 (patch) | |
tree | bc753ce330385f31c870ad5ecc4230e899967599 /lib/sqlalchemy/exc.py | |
parent | 7adcb1c7443265fc99d05714c964c795f0fe1c13 (diff) | |
download | sqlalchemy-4bc2402cc0bc585af1d0e7d59000f73cf20cf452.tar.gz |
- Changed the handling in determination of join
conditions such that foreign key errors are
only considered between the two given tables.
That is, t1.join(t2) will report FK errors
that involve 't1' or 't2', but anything
involving 't3' will be skipped. This affects
join(), as well as ORM relationship and
inherit condition logic. Will keep the more conservative
approach to [ticket:2153] in 0.6.
Diffstat (limited to 'lib/sqlalchemy/exc.py')
-rw-r--r-- | lib/sqlalchemy/exc.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index 99214dfdd..c52924cfb 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -78,9 +78,18 @@ class NoReferenceError(InvalidRequestError): class NoReferencedTableError(NoReferenceError): """Raised by ``ForeignKey`` when the referred ``Table`` cannot be located.""" + def __init__(self, message, tname): + super(NoReferencedTableError, self).__init__(message) + self.table_name = tname + class NoReferencedColumnError(NoReferenceError): """Raised by ``ForeignKey`` when the referred ``Column`` cannot be located.""" + def __init__(self, message, tname, cname): + super(NoReferencedColumnError, self).__init__(message) + self.table_name = tname + self.column_name = cname + class NoSuchTableError(InvalidRequestError): """Table does not exist or is not visible to a connection.""" |