summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-11-27 01:40:18 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-11-27 01:40:18 +0000
commitaecce3479727d0fd8c754a8ba5233b02d0c70b80 (patch)
treedba7b171139f470e05b657581e362afe4668b543 /lib/sqlalchemy/schema.py
parenta284d1e860ae3a92a98592556e94a8aec8ea63f6 (diff)
downloadsqlalchemy-aecce3479727d0fd8c754a8ba5233b02d0c70b80.tar.gz
mysql somewhat present
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 30a2bceed..983ce7084 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -63,13 +63,14 @@ class TableSingleton(type):
autoload = kwargs.pop('autoload', False)
redefine = kwargs.pop('redefine', False)
mustexist = kwargs.pop('mustexist', False)
+ useexisting = kwargs.pop('useexisting', False)
key = _get_table_key(engine, name, schema)
table = engine.tables[key]
if len(args):
if redefine:
table.reload_values(*args)
- else:
- raise "Table '%s.%s' is already defined. specify 'redefine=True' to remap columns" % (schema, name)
+ elif not useexisting:
+ raise "Table '%s.%s' is already defined. specify 'redefine=True' to remap columns, or 'useexisting=True' to use the existing table" % (schema, name)
return table
except KeyError:
if mustexist: