diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-28 15:54:28 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-28 15:54:28 -0500 |
commit | 96dce7686c6a32ab03ce2ccaabb7a9b4ff0fe56b (patch) | |
tree | 9468e4f0c5ee4748a21c2a2aaba7d1ddb0a74db0 /lib/sqlalchemy/engine/reflection.py | |
parent | b7f7ed210501a405938bf55e08a47e35674f0247 (diff) | |
download | sqlalchemy-96dce7686c6a32ab03ce2ccaabb7a9b4ff0fe56b.tar.gz |
- [feature] New reflection feature "autoload_replace";
when set to False on Table, the Table can be autoloaded
without existing columns being replaced. Allows
more flexible chains of Table construction/reflection
to be constructed, including that it helps with
combining Declarative with table reflection.
See the new example on the wiki. [ticket:2356]
- [bug] Improved the API for add_column() such that
if the same column is added to its own table,
an error is not raised and the constraints
don't get doubled up. Also helps with some
reflection/declarative patterns. [ticket:2356]
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r-- | lib/sqlalchemy/engine/reflection.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index 947423334..f5911f3b6 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -317,7 +317,7 @@ class Inspector(object): info_cache=self.info_cache, **kw) return indexes - def reflecttable(self, table, include_columns): + def reflecttable(self, table, include_columns, exclude_columns=None): """Given a Table object, load its internal constructs based on introspection. This is the underlying method used by most dialects to produce @@ -374,6 +374,8 @@ class Inspector(object): name = col_d['name'] if include_columns and name not in include_columns: continue + if exclude_columns and name in exclude_columns: + continue coltype = col_d['type'] col_kw = { |