summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-02-04 23:41:07 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-02-04 23:41:07 +0000
commitf0aa20cab011488b1cdecb5ed9bc68fc1ef1f73e (patch)
treed3d6bdb1b4608a3d4201916afcde6ea7f7a7d779 /lib/sqlalchemy
parent59a5298b3acdb6b2ed9255b58349d7fb9bd10d6e (diff)
downloadsqlalchemy-f0aa20cab011488b1cdecb5ed9bc68fc1ef1f73e.tar.gz
columns can be specified to override those from autoload=True
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/schema.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 6679c8b05..a5e6e0777 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -81,14 +81,16 @@ class TableSingleton(type):
except KeyError:
if mustexist:
raise "Table '%s.%s' not defined" % (schema, name)
- table = type.__call__(self, name, engine, *args, **kwargs)
+ table = type.__call__(self, name, engine, **kwargs)
engine.tables[key] = table
# load column definitions from the database if 'autoload' is defined
# we do it after the table is in the singleton dictionary to support
# circular foreign keys
if autoload:
engine.reflecttable(table)
-
+ # initialize all the column, etc. objects. done after
+ # reflection to allow user-overrides
+ table._init_items(*args)
return table
@@ -98,7 +100,7 @@ class Table(SchemaItem):
Be sure to look at sqlalchemy.sql.TableImpl for additional methods defined on a Table."""
__metaclass__ = TableSingleton
- def __init__(self, name, engine, *args, **kwargs):
+ def __init__(self, name, engine, **kwargs):
"""Table objects can be constructed directly. The init method is actually called via
the TableSingleton metaclass. Arguments are:
@@ -138,7 +140,6 @@ class Table(SchemaItem):
self.primary_key = []
self.engine = engine
self._impl = self.engine.tableimpl(self)
- self._init_items(*args)
self.schema = kwargs.pop('schema', None)
if self.schema is not None:
self.fullname = "%s.%s" % (self.schema, self.name)