diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-02 01:15:26 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-02 01:15:26 +0000 |
| commit | 5932e8649d051d2186cd06fb67f3249a11e57638 (patch) | |
| tree | 3d2db3fe6b31ac78355409b03bc340cbcc6fe5d5 /lib/sqlalchemy | |
| parent | e3460573d037e27592995277a19840be13457828 (diff) | |
| download | sqlalchemy-5932e8649d051d2186cd06fb67f3249a11e57638.tar.gz | |
- an unfortunate naming conflict
- needed sql import on and()
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/exceptions.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/schema.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/util.py | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/exceptions.py b/lib/sqlalchemy/exceptions.py index 747a519f6..43623df93 100644 --- a/lib/sqlalchemy/exceptions.py +++ b/lib/sqlalchemy/exceptions.py @@ -65,7 +65,7 @@ class AssertionError(SQLAlchemyError): class NoSuchColumnError(KeyError, SQLAlchemyError): """Raised by ``RowProxy`` when a nonexistent column is requested from a row.""" -class NoSuchTableError(InvalidRequestError): +class NoReferencedTableError(InvalidRequestError): """Raised by ``ForeignKey`` when the referred ``Table`` cannot be located.""" class DisconnectionError(SQLAlchemyError): diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 5ca9573ad..66d1a1736 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -782,7 +782,7 @@ class ForeignKey(SchemaItem): else: (schema,tname,colname) = m.group(1,2,3) if _get_table_key(tname, schema) not in parenttable.metadata: - raise exceptions.NoSuchTableError( + raise exceptions.NoReferencedTableError( "Could not find table '%s' with which to generate a " "foreign key" % tname) table = Table(tname, parenttable.metadata, diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 0c85cbe4a..d299982cf 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -72,7 +72,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False): for fk in b.foreign_keys: try: col = fk.get_referent(a) - except exceptions.NoSuchTableError: + except exceptions.NoReferencedTableError: if ignore_nonexistent_tables: continue else: @@ -86,7 +86,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False): for fk in a.foreign_keys: try: col = fk.get_referent(b) - except exceptions.NoSuchTableError: + except exceptions.NoReferencedTableError: if ignore_nonexistent_tables: continue else: @@ -110,7 +110,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False): elif len(crit) == 1: return (crit[0]) else: - return and_(*crit) + return sql.and_(*crit) def reduce_columns(columns, *clauses): |
