diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-03 04:34:12 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-03 04:34:12 +0000 |
commit | decc3247b48d0cdfb70ed26a971cbaeb0079a0b4 (patch) | |
tree | fc47cc73252b51bb08a9774f55135af5a8fd56c2 /lib/sqlalchemy/sql.py | |
parent | 9a205e891d9b63ee83590a20772f3ee22e713398 (diff) | |
download | sqlalchemy-decc3247b48d0cdfb70ed26a971cbaeb0079a0b4.tar.gz |
added a third "mapper" to a many-to-many relationship that becomes the dependency in the "middle", thus allowing circular many-to-many relationships
added testcase to the 'double' test suite (whose name will change...)
small fix to table.get_col_by_original
added **kwargs to EagerLazyOption so other property options can be sent through
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 937bc9047..486404f33 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -256,7 +256,7 @@ class ClauseElement(object): Note that since ClauseElements may be mutable, the hash_key() value is subject to change if the underlying structure of the ClauseElement changes.""" - raise NotImplementedError(repr(self)) + raise NotImplementedError(repr(self)) def _get_from_objects(self): raise NotImplementedError(repr(self)) def _process_from_dict(self, data, asfrom): @@ -772,7 +772,14 @@ class TableImpl(Selectable): engine = property(lambda s: s.table.engine) def get_col_by_original(self, column): - return self.columns.get(column.key, None) + try: + col = self.columns[column.key] + except KeyError: + return None + if col.original is column: + return col + else: + return None def group_parenthesized(self): return False @@ -1048,7 +1055,7 @@ class UpdateBase(ClauseElement): else: try: d[self.table.columns[str(key)]] = value - except AttributeError: + except KeyError: pass # create a list of column assignment clauses as tuples |