From 4bc2402cc0bc585af1d0e7d59000f73cf20cf452 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 7 May 2011 12:52:25 -0400 Subject: - 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. --- lib/sqlalchemy/exc.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/sqlalchemy/exc.py') 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.""" -- cgit v1.2.1