diff options
| author | Jason Kirtland <jek@discorporate.us> | 2008-05-15 16:20:50 +0000 |
|---|---|---|
| committer | Jason Kirtland <jek@discorporate.us> | 2008-05-15 16:20:50 +0000 |
| commit | f7cc199d37e1a428b0d62b545b73c7d6d2c898dc (patch) | |
| tree | 1cb81f70ebfb6a5c9e06c6ed4592c7126368238d /lib | |
| parent | 590e74182f68a8932e8c4d2c4b53da28b316ffdf (diff) | |
| download | sqlalchemy-f7cc199d37e1a428b0d62b545b73c7d6d2c898dc.tar.gz | |
Don't blat Table.quote= when resolving foreign keys.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/schema.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index a632a19c9..1611697f4 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -219,6 +219,11 @@ class Table(SchemaItem, expression.TableClause): self._set_parent(metadata) + self.quote = kwargs.pop('quote', None) + self.quote_schema = kwargs.pop('quote_schema', None) + if kwargs.get('info'): + self._info = kwargs.pop('info') + self.__extra_kwargs(**kwargs) # load column definitions from the database if 'autoload' is defined @@ -249,6 +254,13 @@ class Table(SchemaItem, expression.TableClause): if c.name not in include_columns: self.c.remove(c) + for key in ('quote', 'quote_schema'): + if key in kwargs: + setattr(self, key, kwargs.pop(key)) + + if 'info' in kwargs: + self._info = kwargs.pop('info') + self.__extra_kwargs(**kwargs) self.__post_init(*args, **kwargs) @@ -263,17 +275,11 @@ class Table(SchemaItem, expression.TableClause): ['autoload', 'autoload_with', 'schema', 'owner'])) def __extra_kwargs(self, **kwargs): - self.quote = kwargs.pop('quote', None) - self.quote_schema = kwargs.pop('quote_schema', None) - if kwargs.get('info'): - self._info = kwargs.pop('info') - # validate remaining kwargs that they all specify DB prefixes if len([k for k in kwargs if not re.match(r'^(?:%s)_' % '|'.join(databases.__all__), k)]): raise TypeError("Invalid argument(s) for Table: %s" % repr(kwargs.keys())) self.kwargs.update(kwargs) - def __post_init(self, *args, **kwargs): self._init_items(*args) |
